LearnPy Hub
← Arena
AdvancedRating 1600

Draw Without Lifting the Pen

Can you trace every edge of the connected undirected graph exactly once in one stroke (start and end anywhere)? Print YES or NO.

Input

n and m; then m lines 'u v' (the graph is connected).

Output

YES or NO.

Sample 1

Input
4 4
1 2
2 3
3 4
4 1
Output
YES

Sample 2

Input
4 3
1 2
1 3
1 4
Output
NO
solution.py
Output appears here
Draw Without Lifting the Pen · Python Arena problem · LearnPy Hub