跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F1923. Appleman and Easy Task

    ID: 1929 传统题 2000ms 256MiB 尝试: 0 已通过: 0 难度: 1 上传者: 标签>枚举模拟算法思想编程与模拟入门难度共享题库Codeforces英文题面题目来源题面语言

Appleman and Easy Task

题目描述

A. Appleman and Easy Task
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

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

题目来源:fps-www.educg.net-codeforce-1-2833.xml.zip;FPS 共享题包,题包内第 1501 题。保留原作者与原赛事署名。