PROGRAMMING:Relation
Maybe you don't know that one of your friends is your relative. He may be the grandson of your great grandfather's grandfather's son-in-law's niece's cousin. If we can get a complete genealogy, it should be feasible to judge whether two people are related or not. However, if two people's recent public ancestors are several generations away from them, which makes the genealogy very large, it is beyond human power to test the relationship between them. In this case, the best helper is the computer. In order to simplify the problem, you will get some relative information, such as Mary and Tom are relatives, Tom and Ben are relatives, and so on. From this information, you can tell that Mary and Ben are relatives. Please write a program to answer our questions about kinship as quickly as possible.
###Input format:
The input consists of two parts.
The first part starts with "n" and "m"` N 'is the number of people involved in the problem (` 1 ≤ n ≤ 20000'). The numbers of these people are '1,2,3,..., n'. There are'm 'rows below (` 1 ≤ m ≤ 1 000 000'). Each row has two numbers AI and Bi, indicating that AI and Bi are known relatives.
The second part starts with 'Q'. The following 'Q' line has' Q 'queries (` 1 ≤ Q ≤ 1 000 000'), and each line Ci, di means to ask whether Ci and di are relatives.
###Output format:
For each query Ci, Di, output a line: if Ci and di are relatives, output 'yes', otherwise output' no '.
###Input example:
```in
10 7
2 4
5 7
1 3
8 9
1 2
5 6
2 3
three
3 4
7 10
8 9
```
###Output example:
```out
Yes
No
Yes
```
answer:If there is no answer, please comment
###Input format:
The input consists of two parts.
The first part starts with "n" and "m"` N 'is the number of people involved in the problem (` 1 ≤ n ≤ 20000'). The numbers of these people are '1,2,3,..., n'. There are'm 'rows below (` 1 ≤ m ≤ 1 000 000'). Each row has two numbers AI and Bi, indicating that AI and Bi are known relatives.
The second part starts with 'Q'. The following 'Q' line has' Q 'queries (` 1 ≤ Q ≤ 1 000 000'), and each line Ci, di means to ask whether Ci and di are relatives.
###Output format:
For each query Ci, Di, output a line: if Ci and di are relatives, output 'yes', otherwise output' no '.
###Input example:
```in
10 7
2 4
5 7
1 3
8 9
1 2
5 6
2 3
three
3 4
7 10
8 9
```
###Output example:
```out
Yes
No
Yes
```
answer:If there is no answer, please comment