#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int t, p = 0, k;
  vector<vector<char> > a(n, vector<char>(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++) {
      t = 0;
      if (i != 0)
        if (a[i - 1][j] == 'o') t++;
      if (j != 0)
        if (a[i][j - 1] == 'o') t++;
      if (i != n - 1)
        if (a[i + 1][j] == 'o') t++;
      if (j != n - 1)
        if (a[i][j + 1] == 'o') t++;
      if (t % 2 != 0)
        break;
      else
        p++;
    }
  }
  if (p == (n * n))
    cout << "YES" << '\n';
  else
    cout << "NO" << '\n';
  return 0;
}
