#include <bits/stdc++.h>
using namespace std;
const int MAXN = 103;
int N;
int a[MAXN][MAXN];
const int dx[] = {0, 0, -1, 1};
const int dy[] = {-1, 1, 0, 0};
int main() {
  char c;
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) {
    scanf("%c", &c);
    for (int j = 1; j <= N; j++) {
      scanf("%c", &c);
      if (c == 'o') a[i][j] = 1;
    }
  }
  bool f = true;
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= N; j++) {
      int t = 0;
      for (int k = 0; k < 4; k++) {
        t += a[i + dx[k]][j + dy[k]];
      }
      if (t % 2 == 1) f = false;
    }
  }
  if (f)
    printf("YES\n");
  else
    printf("NO\n");
}
