Vladik had started reading a complicated book about algorithms containing n pages. To improve understanding of what is written, his friends advised him to read pages in some order given by permutation P = [p_1, p_2, ..., p_{n}], where p_{i} denotes the number of page that should be read i-th in turn.

Sometimes Vladik’s mom sorted some subsegment of permutation P from position l to position r inclusive, because she loves the order. For every of such sorting Vladik knows number x — what index of page in permutation he should read. He is wondered if the page, which he will read after sorting, has changed. In other words, has p_{x} changed? After every sorting Vladik return permutation to initial state, so you can assume that each sorting is independent from each other.


-----Input-----

First line contains two space-separated integers n, m (1 ≤ n, m ≤ 10^4) — length of permutation and number of times Vladik's mom sorted some subsegment of the book.

Second line contains n space-separated integers p_1, p_2, ..., p_{n} (1 ≤ p_{i} ≤ n) — permutation P. Note that elements in permutation are distinct.

Each of the next m lines contains three space-separated integers l_{i}, r_{i}, x_{i} (1 ≤ l_{i} ≤ x_{i} ≤ r_{i} ≤ n) — left and right borders of sorted subsegment in i-th sorting and position that is interesting to Vladik.


-----Output-----

For each mom’s sorting on it’s own line print "Yes", if page which is interesting to Vladik hasn't changed, or "No" otherwise.


-----Examples-----
Input
5 5
5 4 3 2 1
1 5 3
1 3 1
2 4 3
4 4 4
2 5 3

Output
Yes
No
Yes
Yes
No

Input
6 5
1 4 3 2 5 6
2 4 3
1 6 2
4 5 4
1 3 3
2 6 3

Output
Yes
No
Yes
No
Yes



-----Note-----

Explanation of first test case:   [1, 2, 3, 4, 5] — permutation after sorting, 3-rd element hasn’t changed, so answer is "Yes".  [3, 4, 5, 2, 1] — permutation after sorting, 1-st element has changed, so answer is "No".  [5, 2, 3, 4, 1] — permutation after sorting, 3-rd element hasn’t changed, so answer is "Yes".  [5, 4, 3, 2, 1] — permutation after sorting, 4-th element hasn’t changed, so answer is "Yes".  [5, 1, 2, 3, 4] — permutation after sorting, 3-rd element has changed, so answer is "No".

Difficulty: interview

Starter code:

Solutions:
n, m = list(map(int, input().split()))
p = list(map(int, input().split()))

for _ in range(m):
    l, r, x = list(map(int, input().split()))
    px = p[x - 1]
    cnt = l
    for i in range(l, r + 1):
        if p[i - 1] < px:
            cnt += 1
    if cnt == x:
        print("Yes")
    else:
        print("No")


def get_min(p,l,r, x):
    v = p[x-1]
    c = 0
    for i in range(l-1,r):
        if p[i] < v:
            c += 1
    if c == x - l:
        return True
    else:
        return False

n,m = list(map(int, input().split()))
p = list(map(int, input().split()))
for _ in range(m):
    l,r,x = list(map(int, input().split()))
    if x <= r and x >= l:
        if get_min(p,l,r,x):
            print('Yes')
        else:
            print('No')
    else:
        print('No')


a, b = list(map(int, input().split()))

p = list(map(int, input().split()))

for i in range(b):
    l, r, x = list(map(int, input().split()))

    l -= 1
    r -= 1
    x -= 1

    ans = 0
    for i in range(l, r+1):
        if p[i] <= p[x]:
            ans+=1
    if ans == x-l+1:
        print("Yes")
    else:
        print("No")



"""
	Author		: Arif Ahmad
	Date  		: 
	Algo  		: 
	Difficulty	: 
"""
from sys import stdin, stdout

def main():
	n, m = [int(_) for _ in input().split()]
	p = [int(_) for _ in input().split()]

	for i in range(m):
		l, r, x = [int(_) for _ in input().split()]
		l -= 1
		r -= 1
		x -= 1
		val = p[x]

		smaller = 0
		for j in range(l, r+1):
			if p[j] < val:
				smaller += 1

		if smaller == x - l: stdout.write('Yes' + '\n')
		else: stdout.write('No' + '\n')


def __starting_point():
    main()

__starting_point()

import math
import bisect

n, m = map(int, input().split())
P = [int(c) for c in input().split()]
b_len = math.ceil(math.sqrt(n))
b = []
for i in range(1000):
    b.append(sorted(P[i*b_len:(i+1)*b_len]))
    if n <= (i+1)*b_len:
        break
b_cnt = len(b)
#print(b)

for i in range(m):
    l, r, x = map(int, input().split())
    l_b = (l-1) // b_len
    r_b = (r-1) // b_len

    if r_b - l_b <= 1:
        sorted_a = sorted(P[l-1:r])
        print("Yes" if P[x-1] == sorted_a[x-1-(l-1)] else "No")
    else:
        _a = sorted(P[l-1:(l_b+1)*b_len]+P[r_b*b_len:r])
        #print(_a)
        idx = bisect.bisect_left(_a, P[x-1])
        #print(idx)
        for j in range(l_b+1, r_b):
            #print(b[j])
            idx += bisect.bisect_left(b[j], P[x-1])
            #print(idx)
        print("Yes" if idx+l == x else "No")

n, m = list(map(int, input().split()))
p = list(map(int, input().split()))
for _ in range(m):
    l, r, x = map(int, input().split())
    l -= 1
    r -= 1
    x -= 1
    a = 0
    t = p[x]
    for i in range(l, r + 1):
        a += p[i] < t
    if a == x - l: print("Yes")
    else: print("No")

n, m = list(map(int, input().split()))
p = list(map(int, input().split()))
for _ in range(m):
    l, r, x = map(int, input().split())
    l -= 1
    r -= 1
    x -= 1
    a = 0
    t = p[x]
    for s in p[l:r+1]:
        a += s < t
    if a == x - l: print("Yes")
    else: print("No")

n, m = list(map(int, input().split()))
p = list(map(int, input().split()))
for _ in range(m):
    l, r, x = map(int, input().split())
    l -= 1
    r -= 1
    x -= 1
    a = 0
    t = p[x]
    for s in p[l:r+1]:
        if s < t:
            a += 1
    if a == x - l: print("Yes")
    else: print("No")

n, m = list(map(int, input().split()))
p = list(map(int, input().split()))
for _ in range(m):
    l, r, x = map(int, input().split())
    l -= 1
    r -= 1
    x -= 1
    a = 0
    t = p[x]
    for i in range(l, r + 1):
        if p[i] < t:
            a += 1
    if a == x - l: print("Yes")
    else: print("No")

n, m = list(map(int, input().split()))
p = list(map(int, input().split()))
for _ in range(m):
    l, r, x = map(int, input().split())
    l -= 1
    r -= 1
    x -= 1
    t = p[x]
    a = sum(map(lambda s : s < t, p[l:r+1]))
    if a == x - l: print("Yes")
    else: print("No")

n, m = [int(x) for x in input().split(" ")]
a = [int(x) for x in input().split(" ")]
for i in range(m):
    l,r,x = [int(x) for x in input().split(" ")]
    smaller = 0
    for i in range(l-1,r):
        if a[i]<a[x-1]:
            smaller += 1
    if smaller == x-l:
        print("Yes")
    else:
        print("No")


def case(p, l, r, x):
    l -= 1
    r -= 1
    x -= 1
    a = 0
    t = p[x]
    for i in range(l, r + 1):
        if p[i] < t:
            a += 1
    if a == x - l:
        return "Yes"
    else:
        return "No"


def __starting_point():
    n, m = list(map(int, input().split()))
    p = [int(i) for i in input().split()]
    for i in range(m):
        l, r, x = list(map(int, input().split()))
        print(case(p, l, r, x))

__starting_point()

def main():
    R = lambda: map(int, input().split())
    n, m = R()
    p = [0] + list(R())
    for _ in range(m):
        l, r, x = R()
        v = p[x]
        c = sum(map(lambda x: x < v, p[l:r+1]))
        print('Yes' if c == x - l else 'No')
main()

def get_min(p,l,r, x):
    v = p[x-1]
    c = 0
    for i in range(l-1,r):
        if p[i] < v:
            c += 1
    if c == x - l:
        return True
    else:
        return False

n,m = map(int, input().split())
p = list(map(int, input().split()))
for _ in range(m):
    l,r,x = map(int, input().split())
    if x <= r and x >= l:
        if get_min(p,l,r,x):
            print('Yes')
        else:
            print('No')
    else:
        print('No')

n,k = list(map(int , input().split()))
l = input()
z = [int(i) for  i in l.split()]
for i in range(k):
    l,r , x = list(map(int, input().split()))
    l,r,x =l-1,r-1,x-1
    y=0
    t = z[x]

    for j in range(l , r+1):


        if z[j]<t:

            y+=1
    if l+y==x:
        print("Yes")
    else:
        print("No")


import sys
# sys.stdin = open('in', 'r')

n, m = list(map(int, input().split()))

arr = list(map(int, input().split()))

for line in sys.stdin:
    l, r, x = list(map(int, line.split()))
    cnt = 0
    for i in range(l-1, r):
        if arr[i] < arr[x - 1]:
            cnt += 1
    if cnt == x - l:
        print("Yes")
    else:
        print("No")


n,k = map(int, input().split())
p = list(map(int, input().split()))
def solve():
    for i in range(k):
        l,r,x = map(int, input().split())
        nrLarger,nrSmaller = r - x, x - l
        cL,cS = 0,0
        if r == l:
            print("Yes")
        else:
            for j in range(l-1,r):
                if p[j] < p[x-1]:
                    cS +=1
                if cS > nrSmaller:
                    break
            print("Yes" if cS == nrSmaller else "No")

solve()

n,m = list(map(int,input().split()))
a = list(map(int,input().split()))
d = dict()
for _ in range(m):
    l,r,x = list(map(int,input().split()))
    if x > r or x < l:
        print("Yes")
    else:
        b = a[l-1:r]
        res = 0
        for item in b:
            if item < a[x-1]:
                res += 1
        if res == x-l:
            print("Yes")
        else:
            print("No")
    


x,y=list(map(int,input().split()))
t=0

awan=list(map(int,input().split()))

for v in range(0,y) :
    l,r,x=list(map(int,input().split()))
    l-=1
    x-=1
    t=0
    for j in range(l,r):
        if awan[x]>awan[j] :
            t+=1
    if (l+t)==x :
        print("Yes")
    else :
        print("No")


n, m = list(map(int, input().split()))

a = list(map(int, input().split()))

for i in range(m):
    l, r, x = list(map(int, input().split()))
    count_less = 0
    for j in range(l-1, r):
        if a[j] < a[x-1]:
            count_less += 1
    new_pos = l + count_less
    if new_pos == x:
        print("Yes")
    else:
        print("No")


m, n = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(n):
	l, r, x = list(map(int, input().split()))
	cnt = 0
	for j in range(l-1, r):
		if b[j] < b[x-1]:
			cnt += 1
	if cnt == x - l:
		print("Yes")
	else:
		print("No")


n, m = map(int, input().split())
p = list(map(int, input().split()))
for _ in range(m):
  l, r, x = map(int, input().split())
  y = p[x-1]
  c = 0
  for z in range(l-1, r):
    if p[z] < y:
      c += 1
  print("Yes" if c == x-l else "No")

n,m=list(map(int,input().split()))
a=list(map(int,input().split()))
for i in range(m):
    l,r,x=[int(x)-1 for x in input().split()]
    for j in range(l,r+1):
        if a[j]<a[x]:
            l+=1
            if l>x:
                break
    if l==x:
        print('Yes')
    else:
        print('No')


##n = int(input())
##a = list(map(int, input().split()))
##print(' '.join(map(str, res)))

[n, m] = list(map(int, input().split()))
p = list(map(int, input().split()))

for i in range(m):
    [l, r, x] = list(map(int, input().split()))
    a = p[x-1]
    cnt = 0
    for j in range(l, r+1):
        if p[j-1] <= a:
            cnt += 1
    if cnt == x-l+1:
        print('Yes')
    else:
        print('No')


arri = lambda: [int(s) for s in input().split()]

n, m = arri()
p = arri()
ans = []
for i in range(m):
    l, r, x = arri()
    no = l - 1
    cur = p[x-1]
    for i in range(l - 1, r):
        if p[i] < cur:
            no -=- 1
    ans.append('Yes' if no == x- 1 else 'No')
print('\n'.join(ans))