Little Sub has learned a new word ’Triple’, which usually means a group with three elements in it. Now he comes up with an interesting problem for you.
Define F(a,b,c) = e^a∗e^b / e^c
Given an positive integer sequence A and some queries. In each query, you have to tell if there exists a triple T = (x, y, z) such that:
1.x, y, z are unique integers.
2.l ≤ x, y, z ≤ r.
3.Ax ≤ Ay ≤ Az.
4.F(Ax,Ay,Az) > 1.
The first line contains two positive integers n, q(1 ≤ n, q ≤ 200000).
The second line contains n positive integers, indicating the integer sequence.
The next q lines describe each query by giving two integer l, r(1 ≤ l ≤ r ≤ n).
All given integers will not exceed 2^31 − 1.
Due to some reasons, when l>r, please consider it as an empty interval. Sorry for it.
For each query, print YES if it exists any legal triple or NO otherwise.