#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char a[100][100];
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  bool flag = true;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      int cnt = 0;
      if (i > 0 && a[i - 1][j] == 'o') cnt++;
      if (i < n - 1 && a[i + 1][j] == 'o') cnt++;
      if (j > 0 && a[i][j - 1] == 'o') cnt++;
      if (j < n - 1 && a[i][j + 1] == 'o') cnt++;
      if (cnt & 1) {
        flag = false;
        break;
      }
    }
    if (flag == false) break;
  }
  if (flag == false)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
