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