# Little Sub and Triples

Tags:   再也不头铁用cin了  单组数据嘛
Time Limit:  1 s      Memory Limit:   256 MB
Submission：1382     AC：218     Score：88.36

## Description

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.

## Input

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.

## Output

For each query, print YES if it exists any legal triple or NO otherwise.

## Samples

input
4 2 1 2 3 4 1 3 2 4
output
NO YES