Appu is trying to learn chess . He took a chessboard , placed all the knights he had in his hand on the chessboard . Please help Appu find out whether any 2 knights attack each other or not.

Input:

n - size of the chess board n x n array with 0 for empty positions and 1 for knight position.

Output

YES if there is an attack NO else

Constraints

0<n<100

Sample Input

4

1 0 0 0

0 1 0 0

0 0 1 0

0 0 0 1

Sample Output

NO