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())
a = list(map(int,input().split()))
h,l = [0],[0]
if n==1:
    lst = [1] 
else:
    if a[0]<=a[1]:
        lst = [0]
    else:
        lst = [1] 
    for i in range(1,n):
        if a[i]>a[i-1]:
            lst.append(lst[-1]+1)
        elif a[i]<a[i-1]:
            lst.append(lst[-1]-1)
        else:
            lst.append(lst[-1])
    
    if lst[0]==1:
        h = [1] 
    else:
        l = [1]

    for i in range(1,n-1):
        if lst[i]>lst[i-1] and lst[i]>lst[i+1]:
            h.append(h[-1]+1)
        else:
            h.append(h[-1])
        if lst[i]<lst[i-1] and lst[i]<lst[i+1]:
            l.append(l[-1]+1)
        else:
            l.append(l[-1])


    if a[-2]<a[-1]:
        h.append(h[-1]+1)
    else:
        h.append(h[-1])
    if a[-2]>a[-1]:
        l.append(l[-1]+1)
    else:
        l.append(l[-1])
for _ in range(q):
    x,y = map(int,input().split())
    x,y = x-1,y-1
    if min(l[y]-l[x],h[y]-h[x])==0:
        print("Yes")
    else:
        print("No")