Given an undirected graph with $N$ vertices and $M$ edges, determine whether it is a chordal graph.
If it is a chordal graph, you must provide any perfect elimination ordering. If it is not a chordal graph, you must provide a cycle of length at least $4$ that does not contain a chord.
Input
The first line contains two integers $N$ and $M$.
The next $M$ lines each contain two integers $x, y$, describing an edge. It is guaranteed that there are no multiple edges or self-loops in the graph.
Output
If the given graph is not a chordal graph:
- Output a line containing
NO. - The next line contains an integer $K$, representing the length of the cycle you found.
- The next line contains $K$ integers $v_0, v_1, \cdots, v_{K-1}$, describing your cycle.
If the given graph is a chordal graph:
- Output a line containing
YES. - The next line contains $N$ integers $u_0, u_1, \cdots, u_{N-1}$, describing a perfect elimination ordering.
If there are multiple valid solutions, you may output any one of them.
Constraints
For all data, $1 \leq N \leq 2 \times 10^5$, $1 \leq M \leq 2 \times 10^5$, $0 \leq x, y < N$, $x \ne y$. The graph contains no multiple edges or self-loops.
Examples
Input 1
4 4
1 3
0 3
1 2
0 1
Output 1
YES
2 0 1 3
Input 2
5 4
0 2
1 3
0 1
3 2
Output 2
NO
4
1 3 2 0
Input 3
10 15
0 1
1 2
2 3
3 4
4 0
5 6
6 7
7 8
8 9
9 5
0 5
1 7
2 9
3 6
4 8
Output 3
NO
5
6 3 2 9 5