#include <bits/stdc++.h>
using namespace std;
char ch;
int n, m;
int main() {
  int A[1000][1000];
  std::ios::sync_with_stdio(false);
  ;
  int n;
  cin >> n;
  int sum;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> ch;
      if (ch == 'o') {
        A[i][j] = 1;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      sum = A[i - 1][j] + A[i][j - 1] + A[i + 1][j] + A[i][j + 1];
      if (sum % 2 == 1) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  return 0;
}
