eolymp
bolt
Try our new interface for solving problems
Problems

Equidistant

Equidistant

Time limit 1 second
Memory limit 128 MiB

In 2019 ICPC subregions structure was changed a little. Now for each subregion, we need to choose the best place for the subregion finals. To make things fair we want to choose a city in such a way that all teams will spend the same amount of time to get there.

To make things simpler we say that all teams will use trains to get to the finals. The railroad system can be represented as a tree where each city is a vertex and some pairs of cities are connected by a railroad. It takes exactly one hour to get from one city to another if they are directly connected.

You are given a description of the railroad system and the cities where teams are located. You need to choose any city that has an equal distance to all teams’ cities or detect that no such city exists.

Input data

First line contains two integers n and m (1mn2 * 10^5) - the number of cities and the number of teams. Each of the following n1 lines contains two integers v[i] and u[i] - the indices of the cities connected by the i-th (1v[i], u[i]n) railroad. It is guaranteed that for each pair of cities there is exactly one simple path connecting them.

Next line contains m integers c[1], c[2], ... , c[m] (1c[i]n) - the cities of the teams. All teams are located in different cities.

Output data

If it is impossible to choose a city fairly, output a single word “NO”. Otherwise, output a the word “YES” at the first line. Second line should contain a single integer - the city where subregion finals should be held. If there is more than one solution, output any of them.

Examples

Input example #1
6 3
1 2
2 3
3 4
4 5
4 6
1 5 6
Output example #1
YES
3
Input example #2
2 2
1 2
1 2
Output example #2
NO
Source 2019 ACM NEERC, Northern Subregion, October 26, Problem E