#include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, 0, 1, 0}, dy[] = {0, -1, 0, 1};
bool inrect(int x, int y, int n) { return 0 <= x && x < n && 0 <= y && y < n; }
bool solve(vector<string>& b, int n) {
  for (int i = 0; i < (n); ++i)
    for (int j = 0; j < (n); ++j) {
      int c = 0;
      for (int k = 0; k < (4); ++k) {
        int ni = i + dx[k], nj = j + dy[k];
        if (!inrect(ni, nj, n)) continue;
        c += b[ni][nj] == 'o';
      }
      if (c & 1) return false;
    }
  return true;
}
int main() {
  int n;
  cin >> n;
  vector<string> b(n);
  for (int i = 0; i < (n); ++i) cin >> b[i];
  cout << (solve(b, n) ? "YES\n" : "NO\n");
  return 0;
}
