#include <bits/stdc++.h>
using namespace std;
void process() {
  string a[105];
  int n, d;
  cin >> n;
  bool flag = 1;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      d = 0;
      if (i > 0 && a[i - 1][j] == 'o') d++;
      if (j < n - 1 && a[i][j + 1] == 'o') d++;
      if (i < n - 1 && a[i + 1][j] == 'o') d++;
      if (j > 0 && a[i][j - 1] == 'o') d++;
      if (d % 2) flag = 0;
    }
  if (flag)
    cout << "YES";
  else
    cout << "NO";
}
int main() { process(); }

### Prompt

Generate a cpp solution to the following problem:

Toastman came up with a very easy task. He gives it to Appleman, but Appleman doesn't know how to solve it. Can you help him?

Given a n × n checkerboard. Each cell of the board has either character 'x', or character 'o'. Is it true that each cell of the board has even number of adjacent cells with 'o'? Two cells of the board are adjacent if they share a side.

Input

The first line contains an integer n (1 ≤ n ≤ 100). Then n lines follow containing the description of the checkerboard. Each of them contains n characters (either 'x' or 'o') without spaces.

Output

Print "YES" or "NO" (without the quotes) depending on the answer to the problem.

Examples

Input

3
xxo
xox
oxx


Output

YES


Input

4
xxxo
xoxo
oxox
xxxx


Output

NO

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
void process() {
  string a[105];
  int n, d;
  cin >> n;
  bool flag = 1;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      d = 0;
      if (i > 0 && a[i - 1][j] == 'o') d++;
      if (j < n - 1 && a[i][j + 1] == 'o') d++;
      if (i < n - 1 && a[i + 1][j] == 'o') d++;
      if (j > 0 && a[i][j - 1] == 'o') d++;
      if (d % 2) flag = 0;
    }
  if (flag)
    cout << "YES";
  else
    cout << "NO";
}
int main() { process(); }

```