#include <bits/stdc++.h>
using namespace std;
char ch[110][110];
bool ok(int n) {
  int a, b, num;
  for (a = 0; a < n; a++)
    for (b = 0; b < n; b++) {
      num = 0;
      if (a - 1 >= 0 && ch[a - 1][b] == 'o') num++;
      if (b - 1 >= 0 && ch[a][b - 1] == 'o') num++;
      if (a + 1 <= n - 1 && ch[a + 1][b] == 'o') num++;
      if (b + 1 <= n - 1 && ch[a][b + 1] == 'o') num++;
      if (num % 2 == 1) return false;
    }
  return true;
}
int main() {
  int n, a, b;
  scanf("%d", &n);
  getchar();
  for (a = 0; a < n; a++) {
    scanf("%s", ch[a]);
  }
  if (ok(n))
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
