#include <bits/stdc++.h>
using namespace std;
char a[101][101];
int main() {
  int n;
  int s = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (a[i + 1][j] == 'o') {
        s++;
      }
      if (a[i][j + 1] == 'o') {
        s++;
      }
      if (a[i - 1][j] == 'o') {
        s++;
      }
      if (a[i][j - 1] == 'o') {
        s++;
      }
      if (s % 2 != 0) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES";
  return 0;
}
