Yo`nalishlar
Hozirda online

Statistika

Masalalar soni: 909

Foydalanuvchilar soni: 8820

Jo'natishlar soni: 714406

Muhokama yozuvlari: 4541

Yangiliklar soni: 97

Yangiliklar izohlari: 1174


So'ngi izohlar

746. Connection
Vaqt limiti: 1 sekund
Xotira limiti: 64 MB

In this task you need to check whether the given undirected graph is connected. That it is possible to go from any vertex to any other along the edges of this graph.

Input

 The first line of the input are given numbers N and M are separated by

spaces  the number of vertices in the graph, respectively (1  N  105, 

0  M  105). The following M lines contain two numbers ui and vi by a

space (1  ui, vi  N); each such line means that the graph there is an edge between vertices ui and vi.

Output

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

Samples

Input

Output

1

3 2

1 2

3 2

YES

2

3 1

1 3

NO

 

 

Tayyorladi: Azat Yusupov
Text from: e-olimp.com
Mening urinishlarim(0) Muhokama (0) Jo'natish Eng yaxshi yechimlar Barcha muvaffaqiyatli urinishlar(73) Barcha urinishlar(193)