B. Lawyers
time limit per test
1 second
memory limit per test
1024 mebibytes
input
standard input
output
standard output

There are $$$N$$$ lawyers. Each lawyer has been charged with committing a fraudulent offense. These $$$N$$$ lawyers try to defend each other and make sure they are acquitted.

Lawyer $$$A$$$ can defend lawyer $$$B$$$ if and only if lawyer $$$B$$$ trusts lawyer $$$A$$$, and there are $$$M$$$ such pairs $$$(A, B)$$$. Note that, if lawyer $$$B$$$ trusts lawyer $$$A$$$, it does not imply that lawyer $$$A$$$ trusts lawyer $$$B$$$.

Each lawyer is very hard-working, so one lawyer can defend any number of others.

Each lawyer is very talented, so anyone who receives at least one defense is unconditionally acquitted. With one exception: if lawyer $$$A$$$ defends lawyer $$$B$$$ and lawyer $$$B$$$ defends lawyer $$$A$$$, it seems very suspicious, and both are found guilty.

Determine whether it is possible or not for all lawyers to be acquitted together.

Input

The first line contains two integers $$$N$$$ and $$$M$$$, the number of lawyers and the number of trust relationships ($$$1 \le N, M \le 200\,000$$$).

The next $$$M$$$ lines describe trust relations. The $$$i$$$-th of these $$$M$$$ lines contains two different integers $$$A_i$$$ and $$$B_i$$$, which means lawyer $$$B_i$$$ trusts lawyer $$$A_i$$$, and so lawyer $$$A_i$$$ can defend lawyer $$$B_i$$$. There are no such $$$i$$$ and $$$j$$$ ($$$1 \le i, j \le M$$$, $$$i \ne j$$$) that $$$A_i = B_i$$$ and $$$A_j = B_j$$$.

Output

Print "YES" (without quotes) if it is possible for all lawyers to be acquitted together. Print "NO" (without quotes) otherwise.

Examples
Input
3 3
1 2
2 3
3 1
Output
YES
Input
4 6
1 2
1 3
1 4
2 3
2 4
3 4
Output
NO
Input
4 4
1 2
2 1
3 4
4 3
Output
NO