Is There a Loop?
Does the undirected graph contain a cycle? (No self-loops or repeated edges.) Print Yes or No.
Input
and , then lines u v.
Output
Yes or No.
Constraints
,
Sample 1
Input
3 3 1 2 2 3 3 1
Output
Yes
Sample 2
Input
4 3 1 2 2 3 3 4
Output
No