404497: GYM101521 A Shuttle Bus
Description
Alex is a driver of a shuttle bus whose working duty is to drive around Byteland and let the tourists do sightseeing there.
The territory of Byteland is strange which can be represent by an grid with exactly 2 rows and N columns. There are M churches on some cells in Byteland where sightseeing there are forbidden. On the other hand, there is an attraction in each of the remaining cells.
On each day, Alex drives the shuttle bus from the frontier of Byteland, which is the top-left corner of the 2 × N grid. The shuttle bus can travel from one cell to its adjacent cells which have a common side with it each time. Alex will drive the shuttle bus to visit all attractions. Undoubtedly, he cannot drive into the cells where the churches are located.
Alex does not want to make his tourists bored, so he hopes to visit all attractions, except the churches, exactly once. The tour can end in any cell. Given the length of the grid and the positions of the churches, determine whether Alex can do so successfully.
InputThe first line of contains 2 integers N, M, representing the length of the grid of Byteland and the number of churches there. (1 ≤ N ≤ 109, 1 ≤ M ≤ 5000)
The following M lines contains 2 integers ri, ci, representing the position of the ith church. (1 ≤ ri ≤ 2, 1 ≤ ci ≤ N)
The positions of the churches are distinct and no church will be located at the top-left corner of the grid.
OutputPlease output Yes if Alex can visit all attractions except the churches exactly once and output No otherwise.
ExamplesInput5 3Output
2 1
1 3
2 5
YesInput
3 2Output
2 1
2 3
NoInput
3 2Output
1 2
2 2
No