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