- Time limit: 1.00 s
- Memory limit: 512 MB
There are cities and roads between them. Kaaleppi is currently in city and wants to travel to city .
However, there is a problem: Kaaleppi has recently robbed a bank in city and can't enter the city, because the local police would catch him. Your task is to find out if there is a route from city to city that does not visit city .
As an additional challenge, you have to process queries where , and vary.
Input
The first input line has three integers , and : the number of cities, roads and queries. The cities are numbered .
Then, there are lines describing the roads. Each line has two integers and : there is a road between cities and . Each road is bidirectional.
Finally, there are lines describing the queries. Each line has three integers , and : is there a route from city to city that does not visit city ?
You can assume that there is a route between any two cities.
Output
For each query, print "YES", if there is such a route, and "NO" otherwise.
Constraints
Example
Input:
5 6 3 1 2 1 3 2 3 2 4 3 4 4 5 1 4 2 3 5 4 3 5 2
Output:
YES NO YES