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