#include <bits/stdc++.h>
int main() {
  int x, i, j, top = 0, f = 0;
  char arr[105][105] = {0};
  scanf("%d", &x);
  for (i = 0; i < x; i++) scanf("%s", arr[i]);
  for (i = 0; i < x; i++) {
    for (j = 0; j < x; j++) {
      if (i != x - 1 && arr[i + 1][j] == 'o') top++;
      if (j != x - 1 && arr[i][j + 1] == 'o') top++;
      if (i != 0 && arr[i - 1][j] == 'o') top++;
      if (j != 0 && arr[i][j - 1] == 'o') top++;
      if (top % 2 == 0) f++;
      top = 0;
    }
  }
  if (f == (x * x))
    printf("YES");
  else
    printf("NO");
}
