#include <bits/stdc++.h>
long long max(long long x, long long y) { return x > y ? x : y; }
long long min(long long x, long long y) { return x < y ? x : y; }
using namespace std;
const long long N = 1e3 + 9;
char s[N][N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < n; j++) cin >> s[i][j];
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < n; j++) {
      long long m = 0;
      if (s[i + 1][j] == 'o') m++;
      if (s[i][j + 1] == 'o') m++;
      if (s[i - 1][j] == 'o') m++;
      if (s[i][j - 1] == 'o') m++;
      if (m % 2 == 1) {
        cout << "NO";
        return 0;
      }
    }
  cout << "YES";
}
