#include <bits/stdc++.h>
int main() {
  int n, i, j, cnt, counter = 0;
  scanf("%d", &n);
  char arr[n][n + 1];
  for (i = 0; i < n; i++) {
    scanf(" %[^\n]", arr[i]);
  }
  for (i = 0; i < n; i++) {
    cnt = 0;
    for (j = 0; j < n; j++) {
      if (arr[i][j - 1] == 'o') {
        cnt++;
      }
      if (arr[i][j + 1] == 'o') {
        cnt++;
      }
      if (arr[i - 1][j] == 'o') {
        cnt++;
      }
      if (arr[i + 1][j] == 'o') {
        cnt++;
      }
      if (cnt % 2 == 0) {
        counter++;
      }
    }
  }
  if (counter == n * n) {
    printf("YES");
  } else {
    printf("NO");
  }
}
