Problem: You are given a rooted tree consisting of vertices numbered from to . The root of the tree is a vertex number .
A tree is a connected undirected graph with edges.
You are given queries. The -th query consists of the set of distinct vertices . Your task is to say if there is a path from the root to some vertex such that each of the given vertices is either belongs to this path or has the distance to some vertex of this path.
Input Format: The first line of the input contains two integers and (, ) — the number of vertices in the tree and the number of queries.
Each of the next lines describes an edge of the tree. Edge is denoted by two integers and , the labels of vertices it connects ).
It is guaranteed that the given edges form a tree.
The next lines describe queries. The -th line describes the -th query and starts with the integer () — the number of vertices in the current query. Then integers follow: (), where is the -th vertex of the -th query.
It is guaranteed that all vertices in a single query are distinct.
It is guaranteed that the sum of does not exceed ().
Output Format: For each query, print the answer — "YES", if there is a path from the root to some vertex such that each of the given vertices is either belongs to this path or has the distance to some vertex of this path and "NO" otherwise.
Note: The picture corresponding to the example:
Consider the queries.
The first query is . The answer is "YES" as you can choose the path from the root to the vertex . Then vertices belong to the path from to and the vertex has distance to the vertex which also belongs to this path.
The second query is . The answer is "YES" as you can choose the path to the vertex . Then the vertex has distance to the vertex which belongs to this path and the vertex has distance to the vertex which belongs to this path.
The third query is . The answer is "YES" as you can choose the path to the vertex and all vertices of the query belong to this path.
The fourth query is . The answer is "YES" as you can choose the path to the vertex so vertices and both have distance to the vertex which belongs to this path and the vertex has distance to the vertex which belongs to this path.
The fifth and the sixth queries both have answer "NO" because you cannot choose suitable vertex .