#include <bits/stdc++.h>
using namespace std;
string s1, s2, s[200010];
char ch[102][102];
int main() {
  long long n;
  cin >> n;
  bool flag = 0;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= n; j++) {
      cin >> ch[i][j];
    }
  }
  long long cnt = 0;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= n; j++) {
      cnt = 0;
      if (ch[i - 1][j] == 'o' && i >= 2) {
        cnt++;
      }
      if (ch[i + 1][j] == 'o' && i + 1 <= n) cnt++;
      if (ch[i][j - 1] == 'o' && j - 1 >= 1) {
        cnt++;
      }
      if (ch[i][j + 1] == 'o' && j + 1 <= n) cnt++;
      if (cnt % 2 != 0) {
        flag = 1;
        break;
      }
    }
  }
  if (flag == 1) {
    cout << "NO" << endl;
  } else
    cout << "YES" << endl;
  return 0;
}
