#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, j, x = 0, y = 0;
  char s[101][101];
  cin >> n;
  for (i = 0; i < n; i++) cin >> s[i];
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      y = 0;
      if (s[i - 1][j] == 'o') y++;
      if (s[i][j - 1] == 'o') y++;
      if (s[i + 1][j] == 'o') y++;
      if (s[i][j + 1] == 'o') y++;
      if (y % 2 != 0) x = 1;
    }
  }
  if (x == 1)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
