You've got an array, consisting of *n* integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub>. Also, you've got *m* queries, the *i*-th query is described by two integers *l*<sub class="lower-index">*i*</sub>, *r*<sub class="lower-index">*i*</sub>. Numbers *l*<sub class="lower-index">*i*</sub>, *r*<sub class="lower-index">*i*</sub> define a subsegment of the original array, that is, the sequence of numbers *a*<sub class="lower-index">*l*<sub class="lower-index">*i*</sub></sub>, *a*<sub class="lower-index">*l*<sub class="lower-index">*i*</sub> + 1</sub>, *a*<sub class="lower-index">*l*<sub class="lower-index">*i*</sub> + 2</sub>, ..., *a*<sub class="lower-index">*r*<sub class="lower-index">*i*</sub></sub>. For each query you should check whether the corresponding segment is a ladder. 

A ladder is a sequence of integers *b*<sub class="lower-index">1</sub>, *b*<sub class="lower-index">2</sub>, ..., *b*<sub class="lower-index">*k*</sub>, such that it first doesn't decrease, then doesn't increase. In other words, there is such integer *x* (1 ≤ *x* ≤ *k*), that the following inequation fulfills: *b*<sub class="lower-index">1</sub> ≤ *b*<sub class="lower-index">2</sub> ≤ ... ≤ *b*<sub class="lower-index">*x*</sub> ≥ *b*<sub class="lower-index">*x* + 1</sub> ≥ *b*<sub class="lower-index">*x* + 2</sub>... ≥ *b*<sub class="lower-index">*k*</sub>. Note that the non-decreasing and the non-increasing sequences are also considered ladders.
The first line contains two integers *n* and *m* (1 ≤ *n*, *m* ≤ 10<sup class="upper-index">5</sup>) — the number of array elements and the number of queries. The second line contains the sequence of integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>), where number *a*<sub class="lower-index">*i*</sub> stands for the *i*-th array element.

The following *m* lines contain the description of the queries. The *i*-th line contains the description of the *i*-th query, consisting of two integers *l*<sub class="lower-index">*i*</sub>, *r*<sub class="lower-index">*i*</sub> (1 ≤ *l*<sub class="lower-index">*i*</sub> ≤ *r*<sub class="lower-index">*i*</sub> ≤ *n*) — the boundaries of the subsegment of the initial array.

The numbers in the lines are separated by single spaces.
n,q=map(int,input().split())
arr=list(map(int,input().split()))
val=[-1]*(n)
c=0
i=0
d=0
for ind in range(n):
    if not i and not d:
        val[ind]=c
        i=1
    else:
        if i:
            if arr[ind-1]<=arr[ind]:
                val[ind]=c
                pass
            else:
                val[ind]=c
                i=0
                d=1
        else:
            if arr[ind]<=arr[ind-1]:
                val[ind]=c
            else:
                val[ind]=c+1
                c+=1
                i=1
                d=0
for _ in range(q):
    l,r=map(int,input().split())
    if val[l-1]!=val[r-1]:
        print("No")
    else:
        print("Yes")     
            
