#include <bits/stdc++.h>
using namespace std;
int k1[] = {0, 0, 1, -1};
int k2[] = {1, -1, 0, 0};
char c[102][102];
int main() {
  int n, i, j, d, x, y, t = 0, f = 1;
  cin >> n;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      cin >> c[i][j];
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      for (d = 0; d < 4; d++) {
        x = k1[d] + i;
        y = k2[d] + j;
        if (x < 0 || x >= n || y < 0 || y >= n) {
          continue;
        }
        if (c[x][y] == 'o') {
          t++;
        }
      }
      if (t & 1) {
        f = 0;
        i = j = n;
      }
    }
  }
  if (f == 1) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
