Skip to content
UPEEC

Split into Two Teams

Medium#graphs#bfs#bipartite· solved by 0 · time limit 2.0 s

Each pair u v means members uu and vv must be on different teams. Can all nn members be split into two teams following every rule? Print Yes or No. (Is the graph bipartite?)

Input

nn and mm, then mm lines u v.

Output

Yes or No.

Constraints

1≤n≤1051 \le n \le 10^5, 0≤m≤2×1050 \le m \le 2 \times 10^5

Sample 1

Input

4 4
1 2
2 3
3 4
4 1

Output

Yes

Sample 2

Input

3 3
1 2
2 3
3 1

Output

No

Sign in or join free to run and submit your solution.