Question
Library Study Pairing

A library wants to split N students into two study halls. Some pairs of students distract each other, so each such pair must be placed in different halls.

Determine whether such a split is possible.

The twist: placing one student fixes the expected halls of many other students through chains of restrictions.

Input

The first line contains two integers KaTeX can only parse string typed expression and KaTeX can only parse string typed expression — the number of students and restriction pairs.

Each of the next KaTeX can only parse string typed expression lines contains two integers KaTeX can only parse string typed expression and KaTeX can only parse string typed expression, meaning students KaTeX can only parse string typed expression and KaTeX can only parse string typed expression must be placed in different halls.

Output

Print KaTeX can only parse string typed expression if the split is possible, otherwise print KaTeX can only parse string typed expression.

Example
Example 1:
Input
4 3

1 2
2 3
3 4
Output
YES
Explanation
One possible split is hall A: KaTeX can only parse string typed expression and hall B: KaTeX can only parse string typed expression.

Example 2:
Input
3 3

1 2
2 3
3 1
Output
NO
Explanation
Three students all pairwise conflict, so two halls are not enough.

Online