#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char A[200][200];
  scanf("%d", &n);
  int m = 0;
  for (int i = 1; i <= n; i++) scanf("%s", A[i] + 1);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      int ans = 0;
      if (A[i][j + 1] == 'o') ans++;
      if (A[i][j - 1] == 'o') ans++;
      if (A[i + 1][j] == 'o') ans++;
      if (A[i - 1][j] == 'o') ans++;
      if (ans % 2 == 0) m++;
    }
  if (m == n * n)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
