A tree with vertices is given. Let the distance between two vertices and be . A mirror operation with respect to a vertex is defined as follows.
- When the current vertex is , choose a vertex different from that satisfies , and move to .
- If such a vertex does not exist, the mirror operation with respect to vertex cannot be performed.
A sequence of length is given. Initially, you can choose any vertex as the starting vertex. Determine whether it is possible to reach some vertex of the tree by appropriately choosing a starting vertex and performing the mirror operations with respect to the vertices in order.
Input
The input is given in the following format.
in the input means there is an edge between the two vertices and .
Output
Print YES if there exists a starting vertex and a sequence of moves satisfying the conditions. Otherwise, print NO.
Constraints
- .
- .
- .
- The given vertices and edges form a tree.
- .
Subtasks
Samples
예제 1
입력
3 1
1 2
2 3
2
출력
YES
예제 2
입력
1 1
1
출력
NO
예제 3
입력
4 2
1 2
1 3
1 4
1 1
출력
YES