#include <bits/stdc++.h>
using namespace std;
const long long N = 120;
char a[N][N];
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  bool ok = 1;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      long long e = (i && a[i - 1][j] == 'o' ? 1 : 0) +
                    (j && a[i][j - 1] == 'o' ? 1 : 0) +
                    (i + 1 < n && a[i + 1][j] == 'o' ? 1 : 0) +
                    (j + 1 < n && a[i][j + 1] == 'o' ? 1 : 0);
      if (e & 1) ok = 0;
    }
  }
  if (ok)
    cout << "YES\n";
  else
    cout << "NO\n";
}
