Piet Mondrian was a Dutch painter and art theoretician who is regarded as one of the greatest artists of the 20th century. He is known for being one of the pioneers of 20th-century abstract art, as he changed his artistic direction from figurative painting to an increasingly abstract style, until he reached a point where his artistic vocabulary was reduced to simple geometric elements.
Composition No.10 Pier and Ocean, 1915 After appreciating Piet Mondrian's painting Composition No.10 Pier and Ocean, teralem realized that it was so easy to create an abstract painting. All you need to do is to randomly draw some meaningless lines! No sooner said than done, he took out a large piece of paper and drew $$$n$$$ straight line segments on it, all of which are either vertical or horizontal.
As a curious child, teralem wonders for a given pair of points on the paper, are they connected together by the line segments he drew.
Formally speaking, you are given $$$q$$$ queries. For each query, you are given two points $$$S$$$ and $$$T$$$, and you need to determine if there exists a sequence of line segments $$$L_1, L_2, \dots, L_m$$$ so that $$$S$$$ is on $$$L_1$$$, $$$T$$$ is on $$$L_m$$$ and $$$L_i, L_{i+1}$$$ $$$(1 \leq i \lt m)$$$ have at least one common point(including the endpoints).
The first line contains a single integer $$$n$$$ $$$(1\leq n \leq 10^5)$$$ — the number of line segments.
Each of the next $$$n$$$ lines contains four integers $$$x_1, y_1, x_2, y_2$$$ $$$(-10^9 \leq x_1, y_1, x_2, y_2 \leq 10^9)$$$, denoting a line segment from point $$$(x_1, y_1)$$$ to point $$$(x_2, y_2)$$$. It is guaranteed that $$$x_1 = x_2, y_1 \neq y_2$$$ or $$$x_1 \neq x_2, y_1 = y_2$$$.
The following line contains a single integer $$$q$$$ $$$(1\leq q \leq 10^5)$$$ — the number of queries.
Each of the next $$$n$$$ lines contains four integers $$$x_1, y_1, x_2, y_2$$$, denoting a query of the two points $$$(x_1, y_1)$$$ and $$$(x_2, y_2)$$$.
For each query, output "Yes" or "No" (without quotes) on a separate line, denoting the answer to the query.
5 1 2 4 2 1 4 4 4 3 3 6 3 2 1 2 5 5 1 5 5 3 2 5 3 2 2 2 5 4 5 3 5 3
Yes No Yes
5 3 -23 21 -23 25 -26 25 15 -5 -34 -5 -22 14 -45 14 5 -6 -25 31 -25 3 14 -26 9 -23 14 0 14 0 15 0 15 0
Yes Yes No
The graph of the first example is as below.
| Name |
|---|


