#d2842. 排队

排队

Line Up

Problem Description

Determine whether there is a way to arrange the NN people numbered from 11 to NN in a single line, such that MM given requirements are all satisfied.

Each requirement gives two integers AiA_i and BiB_i, meaning that person AiA_i and person BiB_i must be adjacent.

It is guaranteed that all requirements are distinct — for example, once 1,51, 5 is given, neither 1,51, 5 nor 5,15, 1 will be given again.

Input Format

The first line contains two integers NN and MM, the number of people and the number of requirements.

Output Format

If there is a way to line these people up in a row satisfying all conditions, output Yes; otherwise output No.

Sample Input 1

4 2
1 3
2 3

Sample Output 1

Yes

Sample Input 2

4 3
1 4
2 4
3 4

Sample Output 2

No

Sample Input 3

3 3
1 2
1 3
2 3

Sample Output 3

No

Constraints

For all data: 2≤N≤1052 \leq N \leq 10^5, 0≤M≤1050 \leq M \leq 10^5, 1≤Ai<Bi≤N1 \leq A_i < B_i \leq N.