Limak is a little polar bear. He loves connecting with other bears via social networks. He has n friends and his relation with the i-th of them is described by a unique integer t_{i}. The bigger this value is, the better the friendship is. No two friends have the same value t_{i}.

Spring is starting and the Winter sleep is over for bears. Limak has just woken up and logged in. All his friends still sleep and thus none of them is online. Some (maybe all) of them will appear online in the next hours, one at a time.

The system displays friends who are online. On the screen there is space to display at most k friends. If there are more than k friends online then the system displays only k best of them — those with biggest t_{i}.

Your task is to handle queries of two types:  "1 id" — Friend id becomes online. It's guaranteed that he wasn't online before.  "2 id" — Check whether friend id is displayed by the system. Print "YES" or "NO" in a separate line. 

Are you able to help Limak and answer all queries of the second type?


-----Input-----

The first line contains three integers n, k and q (1 ≤ n, q ≤ 150 000, 1 ≤ k ≤ min(6, n)) — the number of friends, the maximum number of displayed online friends and the number of queries, respectively.

The second line contains n integers t_1, t_2, ..., t_{n} (1 ≤ t_{i} ≤ 10^9) where t_{i} describes how good is Limak's relation with the i-th friend.

The i-th of the following q lines contains two integers type_{i} and id_{i} (1 ≤ type_{i} ≤ 2, 1 ≤ id_{i} ≤ n) — the i-th query. If type_{i} = 1 then a friend id_{i} becomes online. If type_{i} = 2 then you should check whether a friend id_{i} is displayed.

It's guaranteed that no two queries of the first type will have the same id_{i} becuase one friend can't become online twice. Also, it's guaranteed that at least one query will be of the second type (type_{i} = 2) so the output won't be empty.


-----Output-----

For each query of the second type print one line with the answer — "YES" (without quotes) if the given friend is displayed and "NO" (without quotes) otherwise.


-----Examples-----
Input
4 2 8
300 950 500 200
1 3
2 4
2 3
1 1
1 2
2 1
2 2
2 3

Output
NO
YES
NO
YES
YES

Input
6 3 9
50 20 51 17 99 24
1 3
1 4
1 5
1 2
2 4
2 2
1 1
2 4
2 3

Output
NO
YES
NO
YES



-----Note-----

In the first sample, Limak has 4 friends who all sleep initially. At first, the system displays nobody because nobody is online. There are the following 8 queries:  "1 3" — Friend 3 becomes online.  "2 4" — We should check if friend 4 is displayed. He isn't even online and thus we print "NO".  "2 3" — We should check if friend 3 is displayed. Right now he is the only friend online and the system displays him. We should print "YES".  "1 1" — Friend 1 becomes online. The system now displays both friend 1 and friend 3.  "1 2" — Friend 2 becomes online. There are 3 friends online now but we were given k = 2 so only two friends can be displayed. Limak has worse relation with friend 1 than with other two online friends (t_1 < t_2, t_3) so friend 1 won't be displayed  "2 1" — Print "NO".  "2 2" — Print "YES".  "2 3" — Print "YES".

Difficulty: interview

Starter code:

Solutions:
n, k, q = [int(x) for x in input().split()]
T = [int(x) for x in input().split()]
S = set()
for i in range(q):
    t, _id = [int(x) for x in input().split()]
    if t == 1:
        m = min(S, default = 0)
        if len(S) == k:
            if m < T[_id-1]:
                S.remove(m)
                S.add(T[_id-1])
        else:
            S.add(T[_id-1])
    else:
        print('YES' if T[_id-1] in S else 'NO')



n, k, q = map(int, input().split())
data = list(map(int, input().split()))
data1 = set()
for i in range(q):
    typ, fr = map(int, input().split())
    fr -= 1
    if typ == 2:
        if data[fr] in data1:
            print("YES")
        else:
            print("NO")
    else:
        if len(list(data1)) < k:
            data1.add(data[fr])
        elif data[fr] >= min(list(data1)):
            data1.add(data[fr])
            data1.remove(min(list(data1)))

from collections import deque
from math import *
n, k ,q = list(map(int, input().split()))
A = []
lens = 0
B = list(map(int, input().split()))
for i in range(q):
    per1,per2 = list(map(int, input().split()))
    if per1 == 1:
        if lens < k:
            A.append([per2, B[per2-1]])
            lens += 1
        else:
            c = float('infinity')
            r = 0
            for i in range(k):
                if A[i][1] < c:
                    c = A[i][1]
                    r = i
            if B[per2 -1] > A[r][1]:
                
                A[r] = [per2, B[per2-1]]
    else:
        si = True
        for i in range(lens):
            if A[i][0] == per2:
                si = False
                break
        if si:
            print('NO')
        else:
            print('YES')



n, k, q = list(map(int, input().split()))

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

res = set()
data = []

for _ in range(q):
    req_type, req_id = list(map(int, input().split()))

    if req_type == 1:
        req_t = t[req_id - 1]
        data.append((req_id, req_t))
        res.add(req_id)

        if len(res) > k:
            data = sorted(data, key=lambda x: x[1], reverse=True)
            last = data[-1]
            data = data[:-1]

            res.remove(last[0])

    if req_type == 2:
        if req_id in res:
            print('YES')
        else:
            print('NO')


def ke(i):
    return a[i-1]
n,k,q = list(map(int,input().split()))
a = list(map(int,input().split()))
p = []
for i in range(q):
    b,id=list(map(int,input().split()))
    id-=1
    if(b==1):
        p+=[id+1]
        p.sort(key=ke,reverse=True)
        if(len(p)>k):
            p=p[:-1]
    else:
        if id+1 in p:
            print('YES')
        else:
            print('NO')



n,k,q=(int(z) for z in input().split())
s=[int(z) for z in input().split()]
t=[]
ans=[]
for i in range(q):
	r=input()
	if r[0]=='2':
		if s[int(r[2:])-1] in t:
			ans+=['YES']
		else:
			ans+=['NO']
	else:
		if len(t)<k:
			t.append(s[int(r[2:])-1])
			t.sort()
			t.reverse()
		else:
			u=0
			while u<=k-1 and t[u]>s[int(r[2:])-1]:
				u+=1
			if u<k:
				for g in range(k-1,u,-1):
					t[g]=t[g-1]
				t[u]=s[int(r[2:])-1]
for h in ans:
	print(h)



listed = list()

n, k, q= list(map(int,input().split()))


def del_minv():
    nonlocal listed
    minv = 0
    for _ in range(len(listed)):
        if friend_value[listed[_]] < friend_value[listed[minv]]:
            minv = _
    del listed[minv]


friend_value = list(map(int, input().split()))
friend_online = [False]*len(friend_value)

for _ in range(q):
    query = list(map(int,input().split()))
    query[1] -= 1

    if query[0] == 1:
        friend_online[query[1]] = True
        listed.append(query[1])
        if len(listed) > k: del_minv()
        #print(listed)
    else:
        print('YES') if query[1] in listed else print('NO')




import heapq

n, k, qs = list(map(int, input().split()))
arr = [int(i) for i in input().split()]
d = []
for i in range(qs):
    q, ind = list(map(int, input().split()))
    if q == 1:
        heapq.heappush(d, (arr[ind-1], ind))
    if len(d) > k:
        heapq.heappop(d)
    if q == 2:
        if (arr[ind-1], ind) in d: print("YES")
        else: print("NO")


from heapq import heappush, heapreplace

n, k, q, = list(map(int, input().split()))
a = list(map(int, input().split()))
window = []
window_set = set()
min_pr = 10 ** 10
min_pr_id = 0
for i in range(q):
    type, id = list(map(int, input().split()))
    if type == 1:
        if len(window) < k:
            heappush(window, (a[id - 1], id))
            min_pr = min(min_pr, a[id - 1])
        else:
            if a[id - 1] > min_pr:
                heapreplace(window, (a[id - 1], id))
                min_pr = window[0][0]
    else:
        if id in [i[1] for i in window]:
            print('YES')
        else:
            print('NO')



from heapq import * 

n, f, q = [int(s) for s in input().split()]
loves = [int(s) for s in input().split()]
k = []
onlines = set()
for i in range(q):
    ind, num = [int(s) for s in input().split()]
    if ind == 1:
        onlines.add(num - 1)
        if len(k)<f:
            heappush(k, loves[num - 1])
        else:
            heappushpop(k, loves[num-1])
    else:
        if num-1 in onlines and k[0] <= loves[num-1]:
            print("YES")
        else:
            print("NO")


n, k, q = list(map(int, input().split()))
friends = list(map(int, input().split()))
main = [None] * k
for i in range(q):
    t, p = list(map(int, input().split()))
    if t == 1:
        for j in range(k):
            if main[k - j - 1] == None:
                main[k - j - 1] = p - 1
                break
            elif friends[main[k - j - 1]] < friends[p - 1]:
                nn = p - 1
                for l in range(k - j):
                    nnn = main[k - j - l - 1]
                    main[k - j - l - 1] = nn
                    nn = nnn
                break
    elif t == 2:
        if p - 1 in main:
            print("YES")
        else:
            print("NO")


3

import operator as op
from queue import PriorityQueue
import heapq

class StdReader:
	def read_int(self):
		return int(self.read_string())

	def read_ints(self, sep=None):
		return [int(i) for i in self.read_strings(sep)]

	def read_float(self):
		return float(self.read_string())

	def read_floats(self, sep=None):
		return [float(i) for i in self.read_strings(sep)]

	def read_string(self):
		return input()

	def read_strings(self, sep=None):
		return self.read_string().split(sep)

reader = StdReader()


def main():
	n, k, q = reader.read_ints()
	t = reader.read_ints()

	# queue = PriorityQueue()
	queue = []
	qsize = 0

	# online = [False]*n
	# online_n = 0
	# prior = sorted([(i, t[i]) for i in range(n)], key=op.itemgetter(1), inverse=True)
	# pos = [0]*n
	# for i, p in enumerate(prior):
	# 	pos[p[0]] = i

	for i in range(q):
		qt, qid = reader.read_ints()
		qid -= 1

		if qt == 1:
			# qid online
			# online[qid] = True
			# online_n += 1
			if len(queue) == k:
				# queue.get()
				# heapq.heappop(queue)
				# qsize -= 1
				heapq.heappushpop(queue, (t[qid], qid))
			else:
				heapq.heappush(queue, (t[qid], qid))

			# queue.put((t[qid], qid))
			# heapq.heappush(queue, )
			# qsize += 1
		else:
			# query qid
			box = [i[1] for i in queue]
			# print(box)
			if qid in box:
				print('YES')
			else:
				print('NO')

			# if not online[qid]:
			# 	print('NO')
			# else:
			# 	pass


def __starting_point():
	main()

__starting_point()

n, k, q = list(map(int, input().split()))

t = [0] + list(map(int, input().split()))

ts = list()

for i in range(q):
    typ, idi = list(map(int, input().split()))
    if typ == 1:
        cnt = len(ts)
        tl = t[idi]
        if (cnt < k):
            ts.append(tl)
        else:
            if (ts[0] < tl):
                del ts[0]
                ts.append(tl)
        ts.sort()
    elif typ == 2:
        if t[idi] in ts:
            print("YES")
        else:
            print("NO")


n,k,q = map(int,input().split())
t = list(map(int,input().split()))
d = {}
for i in range(n):
    d[i+1] = t[i]

sp = []

for i in range(q):
    a,b = map(int,input().split())
    if a == 1:
        if len(sp) == 0:
            sp.append(b)
        else:
            j = 0
            x = d[b]
            bb = True
            while d[sp[j]] > x:
                j += 1
                if j == len(sp):
                    if len(sp) < k:
                        sp.append(b)
                    bb = False
                    break
            if bb:
                s1 = sp[:j]
                s2 = sp[j:]
                sp = s1 + [b] + s2
                if len(sp) > k:
                    sp.remove(sp[-1])
    else:
        if b in sp:
            print('YES')
        else:
            print('NO')

(n,k,q) = map(int,input().split())
level = list(map(int,input().split()))
qt=[]
qid=[]
lfr = set()

for i in range(0,q):
    (qtemp,qidtemp) = map(int,input().split())
    if (qtemp == 1):
        if (len(lfr)<k):
            lfr.add(qidtemp)
        else:
            minn = qidtemp
            for el in lfr:
                if (level[el-1] < level[minn-1]):
                    minn = el
            if (level[minn-1] != level[qidtemp-1]):
                lfr.remove(minn)
                lfr.add(qidtemp)
    if (qtemp == 2):
        if (qidtemp in lfr):
            print("YES")
        else:
            print("NO")

def Core(size, rate, data):
	online_rate = []
	count = 0
	for item in data:
		if item[0] == 1:
			if size > count:
				count += 1
				online_rate.append(rate[item[1]])
				online_rate.sort(key=lambda x: -x)
			elif online_rate[-1] < rate[item[1]]:
				online_rate[-1] = rate[item[1]]
				online_rate.sort(key=lambda x: -x)
		else:
			if rate[item[1]] in online_rate and online_rate.index(rate[item[1]]) < size:
				print("YES")
			else:
				print("NO")


param1 = input().split(" ")
param2 = [0] + [int(i) for i in input().split(" ")]
param3 = [[int(j) for j in input().split(" ")] for i in range(int(param1[2]))]
Core(int(param1[1]), param2, param3)

str1 = input().split()
n = int(str1[0])
k = int(str1[1])
q = int(str1[2])

friends = list([int(x) for x in input().split()])
online = set()

for i in range(q):
    str1 = input().split()
    if str1[0] == '2':
        if int(str1[1]) in online:
            print("YES")
        else:
            print("NO")
    else:
        online.add(int(str1[1]))
        if len(online) > k:
            minelem = int(str1[1])
            for on in online:
                if friends[on - 1] < friends[minelem - 1]:
                    minelem = on
            online.remove(minelem)
            


n=input()
b=[]
b=n.split()
n=int(b[0])
k=int(b[1])
q=int(b[2])
c=input()
level=c.split()
online=[]
for i in range(q):
    c=input()
    z=c.split()
    if z[0]=='1':
        if len(online)<k:
            online.append(int(z[1]))
        else:
            min=int(level[int(z[1])-1])
            number=-1
            for j in range(k):
                if int(level[online[j]-1])<min:
                    min=int(level[online[j]-1])
                    number=j
            if number>-1:
                online[number]=int(z[1])
    else:
        if online.count(int(z[1]))>0:
            print('YES')
        else:
            print('NO')



import heapq as pq

h = []

n, k, q = list(map(int, input().split()))

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

for _ in range(q):
    t, i = list(map(int, input().split()))
    if t == 1:
        pq.heappush(h, (ts[i - 1], i))
        if len(h) > k:
            pq.heappop(h)
    else:
        if i in [p[1] for p in h]:
            print('YES')
        else:
            print('NO')


import heapq

n, k, q = [int(x) for x in input().split()]
t = [int(x) for x in input().split()]

heap = []
for i in range(q):
    query_type, query_id = [int(x) for x in input().split()]
    if query_type == 1:
        if len(heap) < k or t[query_id - 1] > heap[0]:
            if len(heap) == k:
                heapq.heappop(heap)
            heapq.heappush(heap, t[query_id - 1])
    else:
        print('YES' if t[query_id - 1] in heap else 'NO')


n, size, tasks = map(int, input().split())
friends = list(map(int, input().split()))
online = list()
for i in range(tasks):
    type, id = map(int, input().split())
    id -= 1
    if type == 1:
        adds = friends[id]
        online = sorted(online + [adds], reverse=True)
        if len(online) > size:
            del online[-1]
    else:
        flag_oh_my_god_why = False
        search = friends[id]
        for bear in online:
            if bear == search:
                flag_oh_my_god_why = True
                break
        if flag_oh_my_god_why == False: print('NO')
        else: print('YES')

n, k, q = [int(s) for s in input().split()]
friend_list = [int(s) for s in input().split()]
active_friends_id = dict()

active_friends = [-1 for i in range(k)]
min_value = 0
min_ind = -1
min_key = -1
count = 0
tmp_ind = 0
for i in range(q):
    req, id = [int(s) for s in input().split()]
    id -= 1
    if req == 1:
        if count != k or friend_list[id] > min_value:
            if count == k: # вытеснять
                active_friends_id[min_ind] = id
                active_friends[min_ind] = friend_list[id]
                min_value = min(active_friends)
                min_ind = active_friends.index(min_value)
            else: # добавить
                active_friends_id[tmp_ind] = id
                active_friends[tmp_ind] = friend_list[id]
                tmp_ind += 1
                count += 1
                if count == k:
                    min_value = min(active_friends)
                    min_ind = active_friends.index(min_value)
    else:
        if id in active_friends_id.values():
            print("YES")
        else:
            print("NO")

n,k,q = list(map(int, input().split(' ')))
fr_lvl = list(map(int, input().split(' ')))
lvl = {i + 1: fr_lvl[i] for i in range(len(fr_lvl))}
online = 0
top_six = []
out = []
for step in range(q):
    count = 0
    found = False
    query = input()
    if query[0] == '1':
        online += 1
        if online < k + 1:
            top_six.append(int(query[2:]))
            top_six = sorted(top_six, key = lambda x: lvl[x])
        if online >= k+ 1:
            if lvl[top_six[0]] < lvl[int(query[2:])]:
                top_six[0] = int(query[2:])
                top_six = sorted(top_six, key = lambda x: lvl[x])
    if query[0] == '2':
        out.append(int(query[2:]) in top_six and 'YES' or 'NO')
for i in out:
    print(i)

n,k,q=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]
b=[0]
for i in range(q):
    t,d=[int(x) for x in input().split()]
    if t==2:
         if d in b:
             print('YES')
         else:
             print('NO')
    if b[0]==0:
        b.remove(0)
        b.append(d)
    if t==1:
        for y in range(len(b)):
            if a[d-1]>a[b[y]-1]:
                b.insert(y,d)
                break
        if a[d-1]<a[b[len(b)-1]-1]:
            b.append(d)
        if len(b)==k+1:
            b.pop(len(b)-1)