#include <bits/stdc++.h>
using namespace std;
long long binpow(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
long long isprime(long long n) {
  for (long long i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) return 0;
  }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  char a[n + 1][n + 1];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) cin >> a[i][j];
  }
  int f = 0, cn;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cn = 0;
      if (j < n && a[i][j + 1] == 'o') cn++;
      if (j > 1 && a[i][j - 1] == 'o') cn++;
      if (i < n && a[i + 1][j] == 'o') cn++;
      if (i > 1 && a[i - 1][j] == 'o') cn++;
      if (cn & 1) {
        f = 1;
        break;
      }
    }
    if (f == 1) break;
  }
  if (f == 1)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
