K. Cheater Detector
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

There have been reports of cheating in the ICPC (Interdisciplinary Course for Programming and Cooking) at ETH Zürich! After checking all submitted assignments, a list of cheating reports has been made.

Each report is a pair $$$(X, Y)$$$, meaning that the student with legi $$$X$$$ and the student with legi $$$Y$$$ shared some of their homework. For simplicity, we assume that legi are consecutively indexed, starting with $$$1$$$ (if there are $$$5$$$ students taking the course, they will have a legi of $$$1, 2, 3, 4$$$, and $$$5$$$).

The general consensus is that most ETH students follow the code of conduct, and the current hypothesis is that the students can be divided into 2 types:

  • Cheaters, who cheat whenever they can and with whoever they can.
  • Non-cheaters, who generally don't cheat but might be influenced by cheaters to share some solutions.

Specifically, the hypothesis is that the set $$$V = \{ 1, 2, \dots, N \}$$$ of students can be partitioned into the sets $$$A$$$ and $$$B$$$ such that:

  • For any $$$2$$$ students $$$x$$$ and $$$y$$$ in $$$A$$$, a report with the pair $$$(x, y)$$$ or $$$(y, x)$$$ has been made.
  • For any $$$2$$$ students $$$x$$$ and $$$y$$$ in $$$B$$$, no report with the pair $$$(x, y)$$$ or $$$(y, x)$$$ has been made.

Your task is to verify if such a division of $$$V$$$ into $$$A$$$ and $$$B$$$ exists.

Input

The first line contains the numbers $$$N$$$ ($$$1 \leq N \leq 10^5$$$) and $$$M$$$ ($$$0 \leq M \leq 10^6$$$), representing the number of students taking the course and the number of reports.

Each of the following $$$M$$$ lines contains two numbers $$$x_i$$$ and $$$y_i$$$ ($$$1 \leq x_i, y_i \leq N, x_i \neq y_i$$$), the $$$i$$$-th report.

For any two distinct reports, the corresponding pairs of students are distinct as well.

Output

If a valid partition of the students satisfying the hypothesis exists, print YES. Otherwise, print NO.

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