Problem: There is a grid, consisting of rows and columns. The rows are numbered from to from bottom to top. The columns are numbered from to from left to right. The -th column has the bottom cells blocked (the cells in rows ), the remaining cells are unblocked.
A robot is travelling across this grid. You can send it commands — move up, right, down or left. If a robot attempts to move into a blocked cell or outside the grid, it explodes.
However, the robot is broken — it executes each received command times. So if you tell it to move up, for example, it will move up times ( cells). You can't send it commands while the robot executes the current one.
You are asked queries about the robot. Each query has a start cell, a finish cell and a value . Can you send the robot an arbitrary number of commands (possibly, zero) so that it reaches the finish cell from the start cell, given that it executes each command times?
The robot must stop in the finish cell. If it visits the finish cell while still executing commands, it doesn't count.
Input Format: The first line contains two integers and (; ) — the number of rows and columns of the grid.
The second line contains integers () — the number of blocked cells on the bottom of the -th column.
The third line contains a single integer () — the number of queries.
Each of the next lines contain five integers and (; ; ; ; ) — the row and the column of the start cell, the row and the column of the finish cell and the number of times each your command is executed. The start and the finish cell of each query are unblocked.
Output Format: For each query, print "YES" if you can send the robot an arbitrary number of commands (possibly, zero) so that it reaches the finish cell from the start cell, given that it executes each command times. Otherwise, print "NO".