U538685 DerrickLo's City (UBC002C)
题目背景
This is the English statement of [DerrickLo's City (UBC002C)](https://www.luogu.com.cn/problem/T580724?contestId=203994). **You must submit your solution only in the Chinese version.**
题目描述
In a game, DerrickLo is operating a city. There are $n$ groups in this city. Since the relations between these groups are not very nice, DerrickLo needs to hold some meetings to relieve the relationships.
The city is constructed of $n$ towns indexed from $1$ to $n$. There is exactly one group in each town. The group in town $i$ is indexed $i$. The towns are linked with $n - 1$ roads, so that every two towns can get to each other through these roads.
Every time DerrickLo holds a meeting, he will invite all the groups whose index is in an interval $[l, r]$ to a town $p$, where town $p$ is the place of the meeting. Since the relations are not very nice, groups can not pass by a town whose group is also attending the meeting while going to town $p$.
Because DerrickLo is new to this game, the task of determining town $p$ is handed to you.
输入格式
The first line contains two positive integers $n, q(1 \le n, q \le 10^5)$, the number of towns and the number of meetings.
There are two positive integers $a_i, b_i$ in the next $n - 1$ lines, describing an edge which directly links town $a_i$ and $b_i$. It's guaranteed that these roads forms a tree.
There are two positive integers $l_i, r_i(1 \le l_i \le r_i \le n)$ in the next $q$ lines, which means that DerrickLo invites the groups indexed in $[l_i, r_i]$ to a meeting.
输出格式
For every meeting, if there exists such town $p$, output `Yes`. Otherwise output `No`.
说明/提示
For the first meeting, the place of the meeting can be town $1$, $2$ or $6$.
For the second meeting, it can be proved that no matter which town is chosen, one of group $2, 4$ will pass by the other's town.