C. Graph Subsets
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Consider an undirected tree. A subset of nodes of this tree is called good if there exists a node $$$r$$$ such that if the tree is rooted at $$$r$$$, no node in the subset is an ancestor of another node in the subset.

You are given a connected undirected graph of $$$N$$$ nodes numbered from $$$1$$$ to $$$N$$$ and $$$M$$$ edges numbered from $$$1$$$ to $$$M$$$. Each edge $$$j$$$ connects the nodes $$$U_j$$$ and $$$V_j$$$. The graph has no self-loops or duplicate edges. A subset of nodes of this graph is called ideal if there is some spanning tree of the graph for which this subset of nodes is good.

You are given a subset of nodes of this graph which has size at least 2. Find whether or not it is ideal. If it is ideal, find a valid spanning tree and root as specified above.

Input

The first line contains two integers, $$$N$$$ and $$$M$$$, respectively the number of nodes and number of edges.

The next $$$M$$$ lines describe the edges. The $$$j$$$-th line contains two numbers $$$U_j$$$ and $$$V_j$$$, the endpoints of the $$$j$$$-th edge.

The next line contains a single integer $$$S$$$, the size of the given subset of nodes.

The next line contains $$$S$$$ integers, $$$T_1, ... T_S$$$, the given subset of nodes.

Constraints

  • $$$2 \leq N \leq 3 \times 10^5$$$
  • $$$N-1 \leq M \leq 3 \times 10^5$$$
  • $$$1 \leq U_j \leq N$$$, $$$1 \leq V_j \leq N$$$, $$$U_j \neq V_j$$$ for all $$$1 \leq j \leq M$$$.
  • $$$2 \leq S \leq N$$$
  • $$$1 \leq T_k \leq N$$$ for all $$$1 \leq k \leq S$$$.
  • All $$$T_k$$$ are distinct.
Output

If the given subset is not ideal, you should print a single line which is NO.

If the given subset is ideal, on the first line, you should print YES.

On the second line, you should print your chosen root.

Then, on the next $$$N-1$$$ lines you should describe your chosen spanning tree. Each line should contain the two endpoints of a single chosen edge. The two endpoints may be in any order. The edges themselves may be in any order.

Examples
Input
6 7
1 2
2 3
1 4
5 6
5 1
6 3
4 3
3
4 2 5
Output
YES
1
1 2
1 4
1 5
2 3
5 6
Input
6 7
1 2
2 3
1 4
5 6
5 1
6 3
4 3
3
3 6 5
Output
NO
Note

Samples

In Sample 1, the given subset is ideal. If the spanning tree in the sample output is chosen and rooted at 1, no node in the subset is an ancestor of another node in the subset.

In Sample 2, the given subset is not ideal. It is impossible to choose a valid spanning tree and root.