#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> (n);
  long long ar[n + 2][n + 2];
  memset(ar, 0, sizeof(ar));
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= n; j++) {
      char c;
      cin >> (c);
      if (c == 'o')
        ar[i][j] = 1;
      else
        ar[i][j] = 0;
    }
  }
  bool cnt = 0;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= n; j++) {
      cnt = ((ar[i - 1][j] + ar[i + 1][j] + ar[i][j - 1] + ar[i][j + 1]) % 2)
                ? false
                : true;
      if (!cnt) {
        puts("NO");
        return 0;
      }
    }
  }
  puts("YES");
}
