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