#include <bits/stdc++.h>
using namespace std;
int d[4] = {-1, 0, 1, 0};
int e[4] = {0, -1, 0, 1};
int main() {
  int n, i, j, k;
  scanf("%d", &n);
  char arr[n][n];
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) cin >> arr[i][j];
  int flag = 0;
  int count;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) {
      count = 0;
      for (k = 0; k < 4; k++) {
        int x = i + d[k];
        int y = j + e[k];
        if (x < 0 || y < 0 || x >= n || y >= n) continue;
        if (arr[x][y] == 'o') count++;
      }
      if (count % 2 != 0) {
        printf("NO\n");
        return 0;
      }
    }
  printf("YES\n");
  return 0;
}
