#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<char> v(n);
  vector<vector<char> > b(n, v);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cin >> b[i][j];
  }
  int count, ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      count = 0;
      if (i == 0) {
        if (j == 0) {
          if (i + 1 < n)
            if (b[i + 1][j] == 'o') count++;
          if (j + 1 < n)
            if (b[i][j + 1] == 'o') count++;
        } else if (j == n - 1) {
          if (i + 1 < n)
            if (b[i + 1][j] == 'o') count++;
          if (j - 1 >= 0)
            if (b[i][j - 1] == 'o') count++;
        } else {
          if (i + 1 < n)
            if (b[i + 1][j] == 'o') count++;
          if (j + 1 < n)
            if (b[i][j + 1] == 'o') count++;
          if (j - 1 >= 0)
            if (b[i][j - 1] == 'o') count++;
        }
      } else if (i == n - 1) {
        if (j == 0) {
          if (i - 1 >= 0)
            if (b[i - 1][j] == 'o') count++;
          if (j + 1 < n)
            if (b[i][j + 1] == 'o') count++;
        } else if (j == n - 1) {
          if (i - 1 >= 0)
            if (b[i - 1][j] == 'o') count++;
          if (j - 1 >= 0)
            if (b[i][j - 1] == 'o') count++;
        } else {
          if (i - 1 >= 0)
            if (b[i - 1][j] == 'o') count++;
          if (j + 1 < n)
            if (b[i][j + 1] == 'o') count++;
          if (j - 1 >= 0)
            if (b[i][j - 1] == 'o') count++;
        }
      } else {
        if (j == 0) {
          if (i - 1 >= 0)
            if (b[i - 1][j] == 'o') count++;
          if (i + 1 < n)
            if (b[i + 1][j] == 'o') count++;
          if (j + 1 < n)
            if (b[i][j + 1] == 'o') count++;
        } else if (j == n - 1) {
          if (i - 1 >= 0)
            if (b[i - 1][j] == 'o') count++;
          if (i + 1 < n)
            if (b[i + 1][j] == 'o') count++;
          if (j - 1 >= 0)
            if (b[i][j - 1] == 'o') count++;
        } else {
          if (i - 1 >= 0)
            if (b[i - 1][j] == 'o') count++;
          if (i + 1 < n)
            if (b[i + 1][j] == 'o') count++;
          if (j + 1 < n)
            if (b[i][j + 1] == 'o') count++;
          if (j - 1 >= 0)
            if (b[i][j - 1] == 'o') count++;
        }
      }
      if (count % 2 == 0) ans++;
    }
  }
  if (ans == (n * n))
    cout << "YES";
  else
    cout << "NO";
}
