LearnPy Hub
← Arena
AdvancedRating 1500

Two Teams

Can the people be split into two teams so that every rivalry 'u v' is between different teams? Print YES or NO.

Input

n m, then m lines 'u v'.

Output

YES or NO.

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
solution.py
Output appears here
Two Teams · Python Arena problem · LearnPy Hub