#include <bits/stdc++.h>
using namespace std;
int fx[] = {0, 0, 1, -1};
int fy[] = {1, -1, 0, 0};
int n, i, j, p, q, flag, _count, k;
char s[101][101];
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    scanf("%s", s[i]);
  }
  for (i = 0; i < n; i++) {
    for (k = 0; k < n; k++) {
      for (j = 0; j < 4; j++) {
        p = i + fx[j];
        q = k + fy[j];
        if (p >= 0 && p < n && q >= 0 && q < n && s[p][q] == 'o') _count++;
      }
      if (_count % 2) {
        flag = 1;
        break;
      } else
        _count = 0;
    }
    if (flag) break;
  }
  if (flag)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
