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