#include <bits/stdc++.h>
using namespace std;
int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, -1, 1};
int dX[] = {0, 1, 1, 1, 0, -1, -1, -1};
int dY[] = {-1, -1, 0, 1, 1, 1, 0, -1};
char s[128][128];
int main(void) {
  int N;
  scanf("%d", &N);
  for (int((i)) = (0); ((i)) < ((N)); ((i))++) scanf("%s", s[i]);
  int ok = 1;
  for (int((i)) = (0); ((i)) < ((N)); ((i))++) {
    for (int((j)) = (0); ((j)) < ((N)); ((j))++) {
      int c = 0;
      for (int((k)) = (0); ((k)) < ((4)); ((k))++) {
        int y = i + dy[k];
        int x = j + dx[k];
        if (((y) >= 0 && (x) >= 0 && (y) < N && (x) < N) && s[y][x] == 'o') c++;
      }
      if (c % 2 != 0) {
        ok = 0;
        break;
      }
    }
    if (!ok) break;
  }
  printf("%s\n", ok ? "YES" : "NO");
  return 0;
}
