Denis, Eugene and Misha take professional approach to ACM ICPC. They
don't have any common interests and communicate with each other only
during the competitions. Recently they arrived in Saint Petersburg to
participate in the regional contest and haven't seen each other yet.
At morning before the contest they will leave their hotel at different times
and will go to the contest site, Anichkov palace. Help them find out
if there are such three paths from the hotel to Anichkov palace, that
no two of them share a common road segment.
The first line contains integers n and k (2 ≤ n ≤ 50000;
1 ≤ k ≤ 50000), which are the number of crossroads and the number of road segments in Saint Petersburg,
respectively. Crossroads are numbered with integers from 1 to n.
Each of the following k lines contains two different integers, which are the
numbers of crossroads, connected by a road segment. All road segments are bidirectional.
There is at most one road segment between any
two crossroads. The next line contains the number of test cases q
(1 ≤ q ≤ 50000). Each of the following q lines contains
two different integers, which are the numbers of crossroads, where the hotel and
Anichkov palace are situated, respectively.
For each test case output “Yes” if there are three such paths that no two
of them share a common road segment. Otherwise, output “No”.
Problem Source: Tavrida NU Akai Contest. Petrozavodsk Summer Session, August 2010