def hash1(m, key):
    return key % m

def hash2(m, key):
    return 1 +  key % (m - 1)

def hash(m, key, i):
    return (hash1(m, key) + i * hash2(m, key) ) % m

def insert(T, key):
    i = 0
    l = len(T)
    while True:
        h = hash(1046527,key,i)
        if (T[h] == None ):
            T[h] = key
            return h
        elif (T[h] == key):
            return h
        else:
            i += 1

def search(T,key):
    l = len(T)
    i = 0
    while True:
        h = hash(1046527,key,i)
        if(T[h] == key):
            return h
        elif(T[h] is None or h >= l):
            return -1
        else:
            i += 1

def find(T, key):
    a = search(T,key)
    if(a == -1):
        print('no')
    else:
        print('yes')

dict = {'A' : '1', 'C' : '2', 'G' : '3', 'T' : '4'}
data = []
T = [None]*1046527
n = int(input())


while n > 0:
    st = input()
    d = list(st.split())

### convert key to num(1~4)
    tmp_key = ''
    for x in list(d[1]):
        tmp_key += dict[x]

    data.append([d[0],int(tmp_key)])
    n -= 1
for com in data:
    if(com[0] == 'insert'):
        insert(T,com[1]) 
    else:
        find(T,com[1]) def hash1(m, key):
    return key % m hash1 return key % m key % m key m m m key key def hash2(m, key):
    return 1 +  key % (m - 1) hash2 return 1 +  key % (m - 1) 1 +  key % (m - 1) 1 key % (m - 1) key m - 1 m 1 m m key key def hash(m, key, i):
    return (hash1(m, key) + i * hash2(m, key) ) % m hash return (hash1(m, key) + i * hash2(m, key) ) % m (hash1(m, key) + i * hash2(m, key) ) % m hash1(m, key) + i * hash2(m, key) hash1(m, key) hash1 m key i * hash2(m, key) i hash2(m, key) hash2 m key m m m key key i i def insert(T, key):
    i = 0
    l = len(T)
    while True:
        h = hash(1046527,key,i)
        if (T[h] == None ):
            T[h] = key
            return h
        elif (T[h] == key):
            return h
        else:
            i += 1 insert i = 0 i 0 l = len(T) l len(T) len T while True:
        h = hash(1046527,key,i)
        if (T[h] == None ):
            T[h] = key
            return h
        elif (T[h] == key):
            return h
        else:
            i += 1 True h = hash(1046527,key,i) h hash(1046527,key,i) hash 1046527 key i if (T[h] == None ):
            T[h] = key
            return h
        elif (T[h] == key):
            return h
        else:
            i += 1 T[h] == None T[h] T h None T[h] = key T[h] T h key return h h elif (T[h] == key):
            return h
         T[h] == key T[h] T h key return h h i += 1 i 1 T T key key def search(T,key):
    l = len(T)
    i = 0
    while True:
        h = hash(1046527,key,i)
        if(T[h] == key):
            return h
        elif(T[h] is None or h >= l):
            return -1
        else:
            i += 1 search l = len(T) l len(T) len T i = 0 i 0 while True:
        h = hash(1046527,key,i)
        if(T[h] == key):
            return h
        elif(T[h] is None or h >= l):
            return -1
        else:
            i += 1 True h = hash(1046527,key,i) h hash(1046527,key,i) hash 1046527 key i if(T[h] == key):
            return h
        elif(T[h] is None or h >= l):
            return -1
        else:
            i += 1 T[h] == key T[h] T h key return h h elif(T[h] is None or h >= l):
            return -1
         T[h] is None or h >= l T[h] is None T[h] T h None h >= l h l return -1 -1 i += 1 i 1 T T key key def find(T, key):
    a = search(T,key)
    if(a == -1):
        print('no')
    else:
        print('yes') find a = search(T,key) a search(T,key) search T key if(a == -1):
        print('no')
    else:
        print('yes') a == -1 a -1 print('no') print 'no' print('yes') print 'yes' T T key key dict = {'A' : '1', 'C' : '2', 'G' : '3', 'T' : '4'} dict {'A' : '1', 'C' : '2', 'G' : '3', 'T' : '4'} 'A' 'A' '1' 'C' 'C' '2' 'G' 'G' '3' 'T' 'T' '4' data = [] data [] T = [None]*1046527 T [None]*1046527 [None] None 1046527 n = int(input()) n int(input()) int input() input while n > 0:
    st = input()
    d = list(st.split())

### convert key to num(1~4)
    tmp_key = ''
    for x in list(d[1]):
        tmp_key += dict[x]

    data.append([d[0],int(tmp_key)])
    n -= 1 n > 0 n 0 st = input() st input() input d = list(st.split()) d list(st.split()) list st.split() st.split st split tmp_key = '' tmp_key '' for x in list(d[1]):
        tmp_key += dict[x]

     x list(d[1]) list d[1] d 1 tmp_key += dict[x] tmp_key dict[x] dict x data.append([d[0],int(tmp_key)]) data.append data append [d[0],int(tmp_key)] d[0] d 0 int(tmp_key) int tmp_key n -= 1 n 1 for com in data:
    if(com[0] == 'insert'):
        insert(T,com[1]) 
    else:
        find(T,com[1]) com data if(com[0] == 'insert'):
        insert(T,com[1]) 
    else:
        find(T,com[1]) com[0] == 'insert' com[0] com 0 'insert' insert(T,com[1]) insert T com[1] com 1 find(T,com[1]) find T com[1] com 1 d = list(st.split()) list(st.split()) d tmp_key += dict[x] dict[x] tmp_key def hash(m, key, i):
    return (hash1(m, key) + i * hash2(m, key) ) % m def hash(m, key, i):
    return (hash1(m, key) + i * hash2(m, key) ) % m hash def insert(T, key):
    i = 0
    l = len(T)
    while True:
        h = hash(1046527,key,i)
        if (T[h] == None ):
            T[h] = key
            return h
        elif (T[h] == key):
            return h
        else:
            i += 1 def insert(T, key):
    i = 0
    l = len(T)
    while True:
        h = hash(1046527,key,i)
        if (T[h] == None ):
            T[h] = key
            return h
        elif (T[h] == key):
            return h
        else:
            i += 1 insert dict = {'A' : '1', 'C' : '2', 'G' : '3', 'T' : '4'} {'A' : '1', 'C' : '2', 'G' : '3', 'T' : '4'} dict data = [] [] data n = int(input()) int(input()) n def hash2(m, key):
    return 1 +  key % (m - 1) def hash2(m, key):
    return 1 +  key % (m - 1) hash2 T = [None]*1046527 [None]*1046527 T def hash1(m, key):
    return key % m def hash1(m, key):
    return key % m hash1 n -= 1 1 n def search(T,key):
    l = len(T)
    i = 0
    while True:
        h = hash(1046527,key,i)
        if(T[h] == key):
            return h
        elif(T[h] is None or h >= l):
            return -1
        else:
            i += 1 def search(T,key):
    l = len(T)
    i = 0
    while True:
        h = hash(1046527,key,i)
        if(T[h] == key):
            return h
        elif(T[h] is None or h >= l):
            return -1
        else:
            i += 1 search tmp_key = '' '' tmp_key st = input() input() st def find(T, key):
    a = search(T,key)
    if(a == -1):
        print('no')
    else:
        print('yes') def find(T, key):
    a = search(T,key)
    if(a == -1):
        print('no')
    else:
        print('yes') find
def hash1(m, key):
    return key % m

def hash2(m, key):
    return 1 +  key % (m - 1)

def hash(m, key, i):
    return (hash1(m, key) + i * hash2(m, key) ) % m

def insert(T, key):
    i = 0
    l = len(T)
    while True:
        h = hash(1046527,key,i)
        if (T[h] == None ):
            T[h] = key
            return h
        elif (T[h] == key):
            return h
        else:
            i += 1

def search(T,key):
    l = len(T)
    i = 0
    while True:
        h = hash(1046527,key,i)
        if(T[h] == key):
            return h
        elif(T[h] is None or h >= l):
            return -1
        else:
            i += 1

def find(T, key):
    a = search(T,key)
    if(a == -1):
        print('no')
    else:
        print('yes')

dict = {'A' : '1', 'C' : '2', 'G' : '3', 'T' : '4'}
data = []
T = [None]*1046527
n = int(input())


while n > 0:
    st = input()
    d = list(st.split())

### convert key to num(1~4)
    tmp_key = ''
    for x in list(d[1]):
        tmp_key += dict[x]

    data.append([d[0],int(tmp_key)])
    n -= 1
for com in data:
    if(com[0] == 'insert'):
        insert(T,com[1]) 
    else:
        find(T,com[1])