Duke NIO had 2 sons, Antileaf and Fstqwq, and they would inherit Duke NIO's fief. Duke NIO's fief was composed of 

 cities, and there were 

 bi-direction roads connecting these cities. For fairness, Duke NIO made the following rules for Antileaf and Fstqwq when inheriting his fief: 
 Firstly, both Antileaf and Fstqwq could choose a favorite city. 
 Then, according to the two favorite cities, Duke NIO would make a list. The content of the list is his n cities, and the first item of the list is Antileaf's favorite city while the last item of the list is Fstqwq's favorite city. 
 After that, Antileaf and Fstqwq could begin to inherit his fief. The number of cities each one would get should be determined by drawing a lot. For instance, Antileaf would get the first 

 cities in NIO's list (

 is uniformly random between 

 and 

) while Fstqwq would get the last 

 cities. 
 After all the cities were assigned to his two sons, each son's fief should be a connected component.  
 However, he found that in some cases, he couldn't find a list that meet his requirement. He came out with some questions - if Antileaf chose city 

 as his favorite city and Fstqwq chose city 

, could he always find a list such that Antileaf and Fstqwq's fief would be always connected regardless of the result of the lottery?
 
                            输入描述:
                                                    The first line contains two integers 
 and 
 (
, 
), denoting the number of cities and the number of roads. Then follows 
 lines, each line contains two integers 
 and 
 (
, 
), denotes the roads.
After that follows a line with a single integer 
 (
), which denotes the number of NIO's queries. And then follows 
 lines, each line contains two integers 
 and 
 (
, 
), the meaning is described above.
                                                                            输出描述:
                                                    Output 
 lines. For the 
-th line, if the answer of the 
-th query is true, print "YES" (excluding quotes), otherwise print "NO" (excluding quotes).
                                                                            
                        
                            示例1
                        
                        
                            
                                输入
                                复制
                                
                                
                                    4 3
1 2
2 3
4 3
3
1 3
4 1
3 4
                                 
                             
                            
                                                            
                                    说明
                                    
                                        For the second query, the only valid list is ![[4, 3, 2, 1]](https://www.nowcoder.com/equation?tex=%5B4%2C%203%2C%202%2C%201%5D)
                                     
                                 
                                                     
                     
                                    
                        
                            示例2
                        
                        
                            
                                输入
                                复制
                                
                                
                                    4 6
1 2
1 3
1 4
2 3
2 4
3 4
2
1 4
2 4
                                 
                             
                            
                                                            
                                    说明
                                    
                                        For the first query, one of the valid list is 
.
For the second query, one of the valid list is 
.
                                     
                                 
                                                     
                     
                                                        备注:
                For the second query in the first example, the only valid list is 
.
For the first query in the second example, one valid list is 
.
For the second query in the second example, one valid list is 
.