#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, w, e, r, t;
  char a[100][101];
  scanf("%d", &q);
  for (w = 0; w < q; w++) scanf("%s", a[w]);
  bool b = 1;
  for (w = 0; w < q; w++)
    for (e = 0; e < q; e++) {
      r = 0;
      if ((w) && (a[w - 1][e] == 'o')) r++;
      if ((e) && (a[w][e - 1] == 'o')) r++;
      if ((w < q) && (a[w + 1][e] == 'o')) r++;
      if ((e < q) && (a[w][e + 1] == 'o')) r++;
      if (r % 2 == 1) {
        b = 0;
        break;
      }
    }
  if (b)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
