#include <bits/stdc++.h>
using namespace std;
using std::map;
const int CMAX = 105;
const char Cfd[] = "", Cfr[] = "";
bool B[CMAX][CMAX];
int main() {
  int n;
  string s;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    for (int j = 0; j < n; j++)
      if (s[j] == 'o')
        B[i][j] = true;
      else
        B[i][j] = false;
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      int res = 0;
      if (j > 0 && B[i][j - 1]) res++;
      if (i > 0 && B[i - 1][j]) res++;
      if (j < n - 1 && B[i][j + 1]) res++;
      if (i < n - 1 && B[i + 1][j]) res++;
      if (res % 2 != 0) {
        cout << "NO";
        return 0;
      }
    }
  cout << "YES";
  return 0;
}
