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