Alice has a wheel-graph: an undirected graph with nodes and edges. In wheel-graph there are edges between and i for each integer and edges between i and for each integer (see examples to understand it better). Undirected graphs are quite boring for Alice so she made a directed wheel-graph and now each edge has a direction.
Alice wants performs two types of queries:
Help her.
The first line of the input contains a single integer n - number of nodes without center node.
Then follow lines with edges description. The i-th of these lines contains two integers and - index of node the edge start from, index of node the edge goes to. It is guaranteed that edges formed a correct directed wheel-graph with nodes.
Next line of the input contains a single integer q - number of queries.
Then q lines follow with queries description. The i-th of these lines contains three integers , , - parameters of the i-th query.
For each query of the second type print "Yes" if b can be reached from a and "No" otherwise.
Graph before change
Graph after change in the third query