#P12180. DerrickLo's City (UBC002C)

DerrickLo's City (UBC002C)

Description

In a game, DerrickLo is operating a city. There are nn 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 nn towns indexed from 11 to nn. There is exactly one group in each town. The group in town ii is indexed ii. The towns are linked with n1n - 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][l, r] to a town pp, where town pp 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 pp.

Because DerrickLo is new to this game, the task of determining town pp is handed to you.

Input Format

The first line contains two positive integers n,q(1n,q105)n, q(1 \le n, q \le 10^5), the number of towns and the number of meetings.

There are two positive integers ai,bia_i, b_i in the next n1n - 1 lines, describing an edge which directly links town aia_i and bib_i. It's guaranteed that these roads forms a tree.

There are two positive integers li,ri(1lirin)l_i, r_i(1 \le l_i \le r_i \le n) in the next qq lines, which means that DerrickLo invites the groups indexed in [li,ri][l_i, r_i] to a meeting.

Output Format

For every meeting, if there exists such town pp, output Yes. Otherwise output No.

6 2
1 2
1 3
2 4
2 5
1 6
3 5
2 4

Yes
No

Hint

For the first meeting, the place of the meeting can be town 11, 22 or 66.

For the second meeting, it can be proved that no matter which town is chosen, one of group 2,42, 4 will pass by the other's town.