eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків
Задачі

Sunny Graph

Sunny Graph

Ліміт часу 3 секунди
Ліміт використання пам'яті 64 MiB

The Sun is a great heavenly body. The Sun is worshiped by various religions. Bob loves the Sun and loves any object that is similar to the Sun. He noticed that he can find the shape of the Sun in certain graphs. He calls such graphs "Sunny".

G=(V,E)

vV

G'=(V,E'),E'E

We define the property "Sunny" mathematically. A graph with a vertex is called "Sunny" when there exists a subgraph that has the following two properties. (Be careful, the set of vertices must be the same.)

  1. The connected component containing

    v

    is a cycle that consists of three or more vertices.

  2. Every other component has exactly two vertices.

G'=(V,E')

The following picture is an example of a subgraph that has the above property.

G=(V,E)

1

Given a simple graph (In each edge, two end points are different. Every pair of vertices has one or no edge.) , write a program that decides whether the given graph with the vertex is "Sunny" or not.

Вхідні дані

N

1 ≤ N ≤ 200

M

0 ≤ M ≤ 20,000

N

M

The first line contains two integers (odd, ) and (), separated by a single space. is the number of the vertices and is the number of the edges.

M

v_i

u_i

1 ≤ u_i, v_i ≤ N

u_i, v_i

u_i

v_i

u_i

v_i

(u_i, v_i)

The following lines describe the edges. Each line contains two integers and (). () indicates the edge that connects the two vertices and . and are different, and every pair are different.

Вихідні дані

Print a line containing "Yes" when the graph is "Sunny". Otherwise, print "No".

Приклад

Вхідні дані #1
199 0
Вихідні дані #1
No
Джерело Japan Alumni Group Winter Contest 2012