A. Box
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Little A has a rectangular box with a height of $$$h$$$. He places this box on a table and establishes a three-dimensional Cartesian coordinate system $$$O-xyz$$$, where the table is located at $$$z=z_0$$$.

Due to Little A's obsessive-compulsive disorder, he places the length and width of the box parallel to the $$$x$$$ and $$$y$$$ axes (the length does not necessarily correspond to the $$$x$$$ axis), and the bottom face has a pair of diagonal vertices located at $$$(u_0,v_0,z_0)$$$ and $$$(u_1,v_1,z_0)$$$.

Now Little A has $$$q$$$ queries. For each query, he provides a point $$$(x_i,y_i,z_i)$$$ and wants to know if the point is inside the box (the boundary is also considered inside).

Input

The first line contains six integers $$$z_0,h,u_0,v_0,u_1,v_1$$$ ($$$0\leq z_0,h\leq 10^6$$$, $$$-10^6\leq u_0,v_0,u_1,v_1\leq 10^6$$$).

The second line contains an integer $$$q$$$ ($$$1\leq q\leq 10^3$$$) indicating the number of queries.

The next $$$q$$$ lines each contain three integers $$$x_i,y_i,z_i$$$ ($$$-10^6\leq x_i,y_i,z_i\leq 10^6$$$) representing the $$$i$$$-th query.

Output

Output $$$q$$$ lines. In the $$$i$$$-th line, output a string YES or NO. YES indicates that the queried point is inside the box, while NO indicates that it is not inside the box. The case does not matter, meaning you can output YES, Yes, YeS, yEs and NO, No, nO, etc.

Example
Input
1 1 -1 -1 1 1
3
-1 -1 1
0 0 2
1 2 2
Output
YES
YES
NO