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