#include <bits/stdc++.h>
using namespace std;
int main() {
  ios ::sync_with_stdio(false);
  int n;
  cin >> n;
  char A[n][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++) {
      int cnt = 0;
      if (i != 0) {
        if (A[i - 1][j] == 'o') cnt++;
      }
      if (i != n - 1) {
        if (A[i + 1][j] == 'o') cnt++;
      }
      if (j != 0) {
        if (A[i][j - 1] == 'o') cnt++;
      }
      if (j != n - 1) {
        if (A[i][j + 1] == 'o') cnt++;
      }
      if (cnt % 2 != 0) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES";
  return 0;
}
