#include <bits/stdc++.h>
int main() {
  int n = 0, i = 0, j = 0, flg = 0, cnt = 0;
  std::cin >> n;
  char xo[n][n];
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) std::cin >> xo[i][j];
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      cnt = 0;
      if (xo[i][j - 1] == 'o' && j - 1 >= 0) cnt++;
      if (xo[i - 1][j] == 'o' && i - 1 >= 0) cnt++;
      if (xo[i][j + 1] == 'o' && j + 1 < n) cnt++;
      if (xo[i + 1][j] == 'o' && i + 1 < n) cnt++;
      if (cnt % 2 != 0) {
        std::cout << "NO";
        flg = 1;
        break;
      }
    }
    if (flg == 1) break;
  }
  if (flg == 0) std::cout << "YES";
}
