C. Chess Pieces
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
4
1 0 0 1 -1 0
1 0 0 -1 -1 0
3 1 4 1 5 9
2 7 1 8 2 8
0 0 1 1 2 2
0 0 2 2 1 1
0 0 -1 3 1 5
10 10 13 9 9 5
Output
Yes
No
No
Yes