1997 - [Hnoi2010]Planar

Input

Output

Examples

Input

2 
6 9 
1 4 
1 5 
1 6 
2 4 
2 5 
2 6 
3 4 
3 5 
3 6 
1 4 2 5 3 6 
5 5 
1 2 
2 3 
3 4 
4 5 
5 1 
1 2 3 4 5

Output

NO
YES
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题