#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string arr[n];
  for (int i = 0; i < n; i++) {
    string str;
    cin >> str;
    arr[i] = str;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      int count1 = 0;
      if (i < n - 1 && arr[i + 1][j] == 'o') count1++;
      if (i > 0 && arr[i - 1][j] == 'o') count1++;
      if (j < n - 1 && arr[i][j + 1] == 'o') count1++;
      if (j > 0 && arr[i][j - 1] == 'o') count1++;
      if (count1 % 2 == 1) {
        printf("NO\n");
        return 0;
      }
    }
  }
  printf("YES\n");
}
