The North Pole is running out of funds! Santa Claus has started to work as an Oober driver in the prosperous city of Alert. For this job, Santa must drive people across Alert. The city can be seen as a grid with
It's been snowing in Alert a lot recently, but Santa doesn't have enough money to buy proper winter tires. Due to this, he will not go through any squares with at least
There are two operations:
1 a b c d v
The levels of snow of the squares in the subrectangle with opposing corners
2 a b c d
A query asking if it is possible for Santa to drive someone from
You are given yes
if it is possible and no
if it is not.
Constraints
For all subtasks:
Subtask 1 [30%]
Subtask 2 [30%]
Subtask 3 [40%]
No additional restrictions.
Input Specification
The first line will contain four space-separated integers
The next
Output Specification
For each of the second operations, output its answer on a new line, in the order which they were asked.
Sample Input
3 5 3 10
2 1 1 3 5
1 1 3 2 5 2
2 1 3 2 5
1 2 1 3 3 2
1 1 2 2 2 1
2 1 1 3 3
1 3 1 3 1 5
2 1 1 3 3
2 1 1 3 4
2 2 3 3 5
Sample Output
yes
yes
yes
no
yes
no
Explanation for Sample
For the first operation, all levels of snow are
For the third operation, even though all the squares on any path from
For the sixth operation, there is only one way for Santa to get from
For the eighth operation, Santa cannot get from
For the ninth operation, Santa can move right three times, then down twice.
For the tenth operation, the starting square has too much snow, so it is not possible.
Comments