Since Mr. DeMello hates flavour text, he decides to give you a sleek statement instead:
Given
intervals of , answer queries. Each query comes in the form
L_i R_i
, where you will check if you can move fromto while always being on an interval (i.e., every integer on that interval must be contained in at least one of the intervals). Output
Y
if you can cover the range; otherwise, output N
if you cannot cover the range.
Can you help Mr. DeMello?
Constraints
Input Specification
The first line will contain two integers,
The next
The next
Output Specification
Output
Sample Input
4 3
7 9
-5 4
10 14
16 19
8 10
-5 -5
11 18
Sample Output
Y
Y
N
Comments
Is there any overlaps in the intervals?