#include <bits/stdc++.h>
char c[1007], k[1007][1007];
int n, a[1007][1007], b[109], l, x;
void solve(int n) {
  int i, j, o;
  gets(c);
  for (i = 0; i < n; i++) {
    gets(c);
    for (j = 0; j < n; j++) {
      k[i][j] = c[j];
    }
  }
  for (i = 0; i < 1007; i++) {
    for (j = 0; j < 1007; j++) {
      a[i][j] = 0;
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (k[i][j] == 'o') {
        a[i][j + 1] = a[i][j + 1] + 1;
        a[i + 2][j + 1] = a[i + 2][j + 1] + 1;
        a[i + 1][j] = a[i + 1][j] + 1;
        a[i + 1][j + 2] = a[i + 1][j + 2] + 1;
      }
    }
  }
  o = 1;
  for (i = 1; i < n + 1; i++) {
    for (j = 1; j < n + 1; j++) {
      if ((a[i][j]) % 2 != 0) {
        o = 0;
      }
    }
  }
  if (o == 0) {
    printf("NO");
  } else {
    printf("YES");
  }
}
int main() {
#pragma comment(linker, "/STACK:67108864")
  int n;
  while (scanf("%d", &n) != EOF) {
    solve(n);
  }
  return 0;
}
