AT_awc0004_d 駐車場の割り当て

Description

Takahashi is developing a parking lot management system for a shopping mall. The parking lot has $ N $ parking spaces arranged in a row, numbered Space $ 1 $ , Space $ 2 $ , ..., Space $ N $ from the entrance side. Today, $ M $ cars are scheduled to visit, and all of these cars will use the parking lot during the same time period. The $ i $ -th car ( $ 1 \leq i \leq M $ ) can park in any one of the consecutive parking spaces from Space $ L_i $ to Space $ R_i $ . Each car must be assigned exactly one parking space, and no parking space can be assigned to two or more cars. If it is possible to assign a parking space to every car, output `Yes`; otherwise, output `No`.

Input Format

> $ N $ $ M $ $ L_1 $ $ R_1 $ $ L_2 $ $ R_2 $ $ \vdots $ $ L_M $ $ R_M $ - The first line contains the number of parking spaces $ N $ and the number of arriving cars $ M $ , separated by a space. - The $ i $ -th of the following $ M $ lines contains $ L_i $ and $ R_i $ , representing the range of spaces where the $ i $ -th car can park, separated by a space.

Output Format

Print `Yes` on a single line if it is possible to assign a parking space to every car, or `No` if it is not possible.

Explanation/Hint

### Constraints - $ 1 \leq N \leq 10^5 $ - $ 1 \leq M \leq 10^5 $ - $ 1 \leq L_i \leq R_i \leq N $ ( $ 1 \leq i \leq M $ ) - All input values are integers