#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char ar[n][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> ar[i][j];
    }
  }
  int f = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      int c = 0;
      if (i > 0 && ar[i - 1][j] == 'o') c++;
      if (i < n - 1 && ar[i + 1][j] == 'o') c++;
      if (j > 0 && ar[i][j - 1] == 'o') c++;
      if (j < n - 1 && ar[i][j + 1] == 'o') c++;
      if (c % 2) {
        f = 1;
        break;
      }
    }
    if (f == 1) break;
  }
  if (!f)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
