Mr. Blind and Stefano are best friends and they both study at the same university.
There are mainly two student canteens they can choose from: or . Mr. Blind usually eats at while Stefano at .
In this problem we will focus on Magnan, known for its friendly staff and delicious fruit-based desserts.

Mr. Blind and Stefano decided to eat at Magnan (to Blind's distress, as the € difference in price is tremendous) and have come to pick their desserts.
Like in Figure above, there are desserts given on a line.
For each dessert, we only care about its sweetness and its primary fruit ingredient (i.e. and , for the -th dessert on the line).
Stefano is pretty unpredictable when choosing his desserts but Mr. Blind found out there are exactly preferences he will choose from.
A preference is given by the tuple , where is the interval of how sweet the desserts must be, and is the amount of desserts that must be based on his favourite fruit, denoted by .
Task
Given , , arrays and and the preferences, find out for each one of them whether Mr. Blind can get an order that satisfies it.
Input data
The first line of the input file contains integers and , the number of desserts and Stefano's favourite dessert.
The second line contains integers , representing the sweetness of each dessert.
The third line contains integers , representing the main fruit ingredient of each dessert.
The fourth line contains a single integer , the number of preferences.
Each of the following lines contain three integers, , , , with their meaning explained above.
Output data
The output file must contain lines, each consisting of a single string: the -th line must be YES if Mr. Blind can find a suitable order for the -th preference, and NO otherwise.
Constraints and clarifications
- .
- .
- for each .
- , for each .
- .
- , for each preference.
- , for each preference.
| # | Score | Constraints |
|---|---|---|
| 1 | 0 | Examples |
| 2 | 20 | |
| 3 | 15 | , for all preferences. |
| 4 | 5 | , for all preferences. |
| 5 | 60 | No additional restrictions |
Example 1
stdin
7 3
4 5 7 4 5 3 3
3 2 3 1 6 5 3
3
1 9 2
3 6 2
3 6 3
stdout
YES
YES
NO
Explanation
In the first sample case, we know that , , and .
For the first preference, because and , we notice that any order that has desserts which use as an ingredient is a valid order. As such, for example, the orders given by indices , and are all suitable orders for this preference, so the answer is YES. These are not the only valid orders.
For the second preference, one possible order is .
For the third preference, one can notice that there are only desserts that use , one of them being too sweet. Thus, there are no orders, so the answer is NO.
Example 2
stdin
10 9
10 -2 -8 -6 -7 5 0 3 -8 -5
9 9 9 13 9 9 9 9 12 12
5
-4 -3 6
-5 0 4
-7 -4 3
-9 -7 4
0 4 2
stdout
NO
NO
NO
NO
YES
Explanation
In the second sample case, notice that the sweetness of desserts can also be negative.