#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.precision(6);
  long long int n;
  cin >> n;
  vector<string> v;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    v.push_back(s);
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; j++) {
      int temp = 0;
      if (i - 1 >= 0 and v[i - 1][j] == 'o') temp++;
      if (i + 1 < n and v[i + 1][j] == 'o') temp++;
      if (j - 1 >= 0 and v[i][j - 1] == 'o') temp++;
      if (j + 1 < n and v[i][j + 1] == 'o') temp++;
      if (temp % 2 != 0) {
        cout << "NO" << '\n';
        return 0;
      }
    }
  }
  cout << "YES" << '\n';
  return 0;
}
