#include <bits/stdc++.h>
using namespace std;
char a[102][102];
bool fun(long long int i, long long int j, long long int n) {
  int count = 0;
  if (i + 1 < n && a[i + 1][j] == 'o') count++;
  if (i - 1 >= 0 && a[i - 1][j] == 'o') count++;
  if (j + 1 < n && a[i][j + 1] == 'o') count++;
  if (j - 1 >= 0 && a[i][j - 1] == 'o') count++;
  if (count % 2 == 0)
    return true;
  else
    return false;
}
int main() {
  long long int n, i, j;
  cin >> n;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  long long int f = 0;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (!fun(i, j, n)) {
        f = 1;
        break;
      }
    }
  }
  if (f == 1)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
}
