Problem E
Euler Path
Input
The first line of input contains the integers $N$ and $M$ ($1 \leq N \leq 10^5$, $0 \leq M \leq 10^5$), the number of nodes and edges.
The following $M$ lines each contain the integers $a$ and $b$ ($1 \leq a,b \leq N$), meaning that there is an edge between node $a$ and node $b$.
Output
Print “Yes” if there exists an Euler Path, otherwise “No”.
Sample Input 1 | Sample Output 1 |
---|---|
5 0 |
Yes |
Sample Input 2 | Sample Output 2 |
---|---|
5 1 1 2 |
Yes |
Sample Input 3 | Sample Output 3 |
---|---|
5 2 1 2 3 4 |
No |