Problem3497--【语言基础】CF1062A-Square?

3497: 【语言基础】CF1062A-Square?

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description




Sample Input Copy

7
1 2 3 4
1 1 1 1
2 2 2 2
1 2 1 2
1 1 5 5
5 5 5 5
4 10 5 9

Sample Output Copy

NO
YES
YES
NO
NO
YES
NO

HINT

Source/Category