#include <bits/stdc++.h>
using namespace std;
inline bool isLeapYear(long long y) {
  return ((y % 400 == 0) || (y % 4 == 0 && y % 100 != 0));
}
inline void optimize(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const long long mod = 1e9 + 7;
const double pi = acos(-1.0);
struct func {
  bool operator()(pair<long long, long long> const &a,
                  pair<long long, long long> const &b) {
    if (a.first == b.first) return (a.second < b.second);
    return (a.first > b.first);
  }
};
long long fx[] = {1, -1, 0, 0};
long long fy[] = {0, 0, 1, -1};
int main() {
  optimize();
  long long i, j, k, n, cnt = 0;
  char board[1234][1234];
  cin >> n;
  for (i = 0; i <= n - 1; i++)
    for (j = 0; j <= n - 1; j++) cin >> board[i][j];
  for (i = 0; i <= n - 1; i++) {
    for (j = 0; j <= n - 1; j++) {
      cnt = 0;
      for (k = 0; k <= 3; k++) {
        if (board[i + fx[k]][j + fy[k]] == 'o') cnt++;
      }
      if (cnt & 1) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  return 0;
}
