#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  char c[n][n];
  int x = 0, f = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cin >> c[i][j];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      x = 0;
      if (i + 1 != n && c[i + 1][j] == 'o') x++;
      if (j + 1 != n && c[i][j + 1] == 'o') x++;
      if (i - 1 >= 0 && c[i - 1][j] == 'o') x++;
      if (j - 1 >= 0 && c[i][j - 1] == 'o') x++;
      if (x % 2 != 0) {
        f = 1;
        break;
      }
    }
  }
  if (f == 0)
    cout << "YES";
  else
    cout << "NO";
}
