#include <bits/stdc++.h>
using namespace std;
void file() {
  freopen("input.in", "r", stdin);
  freopen("output.out", "w", stdout);
}
int n, a[201][201], v;
char x;
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      cin >> x;
      if (x == 'o')
        a[i][j] = 1;
      else
        a[i][j] = 0;
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      v = 0;
      v += a[i - 1][j];
      v += a[i][j - 1];
      v += a[i][j + 1];
      v += a[i + 1][j];
      if (v % 2 == 1) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES";
}
