Newspapers

아직 제출이 없습니다시간 제한2초메모리 제한1024 MB

문제

Ulovi me, ulovi me, kupit ću ti novine!” – a popular play song among Croatian children. Translates to catch me, and I’ll buy you newspapers.

Ankica and Branko are playing a chasing game on an undirected, connected graph. Namely, Branko is moving around the graph, while Ankica is attempting to catch him. The game proceeds in turns, and a single turn consists of the following:

  • Ankica makes a guess on Branko’s whereabouts. More precisely, she guesses that Branko is currently located at a specific node. If she guesses correctly, Branko is caught and the game ends. Otherwise,
  • Branko traverses an edge incident to his current location. In other words, Branko moves to one of his neighbouring nodes. Note that Branko cannot stay at his present location.

Given a graph, determine if Ankica has a finite strategy which always catches Branko regardless of the way Branko plays and what his starting position may be.

More formally, we represent Ankica’s strategy as an array A=(a_1,a_2,,a_k)A = (a\_1, a\_2, \dots , a\_k), where a_ia\_i denotes Ankica’s guess in the ii-th turn (i.e. she guesses that Branko is located in the node a_ia\_i).

Similarly, we represent Branko’s movements as an array B=(b_1,b_2,,b_k)B = (b\_1, b\_2, \dots , b\_k), where b_ib\_i represents the node in which Branko is located before the ii-th turn. Additionally, for each two successive elements b_ib\_i and b_i+1b\_{i+1} (1i<k1 \le i < k), there must exist an edge in the graph connecting nodes b_ib\_i and b_i+1b\_{i+1}. Note that no such constraint is imposed on array AA.

We say that Ankica’s strategy is successful, i.e. she catches Branko in at most kk turns, if, for every valid array BB of length kk, there exists some ii (1ik1 \le i \le k) such that a_i=b_ia\_i = b\_i holds.

If such strategy exists, you should find one that minimizes the number kk.

You can score some points in this task if you are able to provide a succesful, but not optimal, strategy for Ankica (i.e. a strategy where kk is not minimal). See the Scoring section for more details.

입력

The first line contains two integers NN and MM (N1MN(N1)2N - 1 \le M \le \frac{N(N-1)}{2}) that represent the number of nodes and edges in the graph (respectively). Nodes of the graph are denoted with integers from 1 to NN.

The ii-th of the next MM lines contains two space-separated integers u_iu\_i and v_iv\_i (1u_i,v_iN1 \le u\_i, v\_i \le N, u_iv_iu\_i \ne v\_i), representing that an undirected edge connects nodes u_iu\_i and v_iv\_i. No edge will appear more than once in the input, and the graph will be connected.

출력

If there is no successful strategy for Ankica, simply output "NO" in the first line and terminate the program.

Otherwise, you should output "YES" in the first line.

The second line should contain the number kk from the task description. The third line should contain kk numbers a_1,a_2,,a_ka\_1, a\_2, \dots , a\_k from the task description.