462_A. Appleman and Easy Task
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
```python
n=int(input())
mat = []
mat.append('x'*(n+2))
for i in range(n):
    mat.append('x'+input()+'x')
mat.append('x'*(n+2))
output = "YES"
for i in range(1,n+1):
    if output == "NO":
        break
    for j in range(1,n+1):
        s=0
        if mat[i][j+1] == 'o':
            s+=1
        if mat[i][j-1] == 'o':
            s+=1
        if mat[i+1][j] == 'o':
            s+=1
        if mat[i-1][j] == 'o':
            s+=1
        if s%2:
            output = "NO"
            break
print(output)
```