### Milk Bottle Data

Time Limit: 1000 ms Memory Limit: 10000 KiB

#### Problem Description

There is a box of the shape of an N*N lattice. Each grid of the lattice may contain a milk bottle or none. Mr. Smith wrote down the data of the box by making a record for each row from left to right and each column from top to bottom. In each record, '1' indicates that there is a bottle in the corresponding grid and '0' does not. Unfortunately, the order of these records is thrown into confusion, and some of these records have corrupted.

Now it's up to you to provide a program to recover these data: i.e. to give the original arrangement of the box and give real values for those corrupted data.

#### Input

First number is N, size of lattice. Records folows, where '2' denotes that the corresponding character has been corrupted. Each line in the file represents a record. You should output the original arrangement of the box, and show the record number for each column on the top of the lattice, and show the record number for each row to the left of the lattice. After the last lattice is '0'.

#### Output

You are required to give only "YES" if there is possible result, or "NO" otherwise.

#### Sample Input

5
10101
10011
10001
10101
00201
11000
00010
01000
00010
10000
2
02
10
11
01
0

#### Sample Output

YES
NO