#SVAREA11. Save Area 11
Save Area 11
In the year 2010 of the Imperial Calendar, the Holy Britannian Empire invaded Japan and overpowered the defending forces. Japan became a dominion of the Empire. The country was stripped off her freedom, her rights and her name. The defeated and once proud nation was given a mere number as a name - Area 11.
After many years, Lelouch vi Britannia, the leader of the Black Knights, is making plans for some important battles against the Holy Britannian Empire army in his quest to free Area 11. He is assigning soldiers of the Black Knights to various strategically advantageous positions on the battlefields.
Lelouch assigns a soldier to a position from T1 second to T2 second. The soldier leaves to fight at the beginning of T1 second and returns at the end of T2 second. During this time, this soldier is unavailable for any other assignments. After returning, he is available for future assignments. A complete plan includes several of these assignments.
The Black Knights does not have unlimited number of soldiers. Lelouch has made plans for several battles and now he is trying to distribute his soldiers to carry out these plans. He takes a plan and allocates N soldiers for it. Then he asks you to check if the plan can be carried out successfully with N soldiers.
Help Lelouch make the plans. The fate of Area 11 depends on you!
Input
Input begins with an integer P (1 ≤ P ≤ 105), indicating the number of plans. Then follows the P plans. Each plan begins with two integers N (0 ≤ N ≤ 109) and A (0 ≤ A ≤ 104), indicating the number of soldiers allocated for that plan and the number of assignments that plan has respectively. The next A lines each contains two integers S and E (1 ≤ S ≤ E ≤ 104), indicating the starting and the ending time of an assignment.
Output
For each plan, print a single line in the format Plan X: Y, where X is the plan number and Y is either Yes or No, indicating whether the plan can be completed successfully or not.
Example
Input:2
3 3
1 3
1 4
1 2
2 3
1 3
1 4
1 2Output:
Plan 1: Yes
Plan 2: No
Note: Dataset is huge. Use faster I/O method.