Strange Graph

No attempts yetTime limit1sMemory limit128 MB

Problem

Consider an undirected graph G=(V,E)G = (V, E). For a vertex vv, write N(v)N(v) for the set of vertices adjacent to vv, and write deg(v)\deg(v) for the size of that set, the degree of vv.

Call GG strange if it is connected and every vertex vv meets all of these conditions.

  1. deg(v)2\deg(v) \ge 2.
  2. If deg(v)=2\deg(v) = 2, the two neighbours of vv are not adjacent to each other.
  3. If deg(v)>2\deg(v) > 2, there is a vertex uN(v)u \in N(v) that satisfies both of the following.
    1. deg(u)=2\deg(u) = 2.
    2. Any two distinct vertices w1,w2N(v){u}w_1, w_2 \in N(v) \setminus \{u\} are adjacent, that is, (w1,w2)E(w_1, w_2) \in E.

A Hamiltonian cycle passes through every vertex of GG exactly once, so its last vertex is adjacent to its first vertex.

You are given a strange graph GG. Decide whether it has a Hamiltonian cycle.

Input

The first line contains two integers NN and MM, the number of vertices and the number of edges of GG (3N100003 \le N \le 10000, M100000M \le 100000).

Then 2M2M integers follow. Taken in order, each consecutive pair gives the two endpoints of one edge. Vertices are numbered from 11 to NN. The numbers are separated by spaces or line breaks, and the split into lines is not fixed. Every edge appears exactly once, and the two endpoints of an edge are always different. GG is guaranteed to be strange.

Output

Print YES if GG has a Hamiltonian cycle, and NO otherwise.