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