Connectivity#492

Connectivity

1 second
128 megabytes
Easy (≈1000)

Check if the given undirected graph is connected. That is, determine whether it is possible to reach any vertex from any other vertex using the edges of the graph.

Input

The first line contains two numbers: n~(1 \le n \le 100) — the number of vertices, and m~(1 \le m \le 10^4) — the number of edges in the graph. Each of the following lines contains two numbers u_i and v_i~(1 \le u_i, v_i \le n), representing an edge between vertices u_i and v_i.

Output

Print "YES" if the graph is connected, and "NO" otherwise.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading