import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

n = I()
M = 1046527
NIL = -1
H = [None] * M
com = []
ch = []

for i in range(n):
    com_, ch_ = input().split()
    com.append(com_)
    ch.append(ch_)


table = str.maketrans({
'A':'1',
'C':'2',
'G':'3',
'T':'4',
})


def getChar(ch):
    return int(ch.translate(table))

def h1(key):
    return key % M
def h2(key):
    return 1 + (key % (M - 1))

def insert(ch):
    key = getChar(ch)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] is None:
            H[h] = ch
            break
        else:
            i += 1

def find(ch):
    key = getChar(ch)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == ch:
            return 1
        elif H[h] is None:
            return 0
        else:
            i += 1


for i in range(n):
    if com[i][0] == 'i':
        insert(ch[i])
    else:
        if find(ch[i]):
            print('yes')
        else:
            print('no') import bisect, collections, copy, heapq, itertools, math, string bisect collections copy heapq itertools math string import sys sys def I(): return int(sys.stdin.readline().rstrip()) I def MI(): return map(int, sys.stdin.readline().rstrip().split()) MI def LI(): return list(map(int, sys.stdin.readline().rstrip().split())) LI def S(): return sys.stdin.readline().rstrip() S def LS(): return list(sys.stdin.readline().rstrip().split()) LS n = I() n I() I M = 1046527 M 1046527 NIL = -1 NIL -1 H = [None] * M H [None] * M [None] None M com = [] com [] ch = [] ch [] for i in range(n):
    com_, ch_ = input().split()
    com.append(com_)
    ch.append(ch_) i range(n) range n com_, ch_ = input().split() com_ input().split() ().split () input split ch_ com.append(com_) com.append com append com_ ch.append(ch_) ch.append ch append ch_ table = str.maketrans({
'A':'1',
'C':'2',
'G':'3',
'T':'4',
}) table str.maketrans({
'A':'1',
'C':'2',
'G':'3',
'T':'4',
}) str.maketrans str maketrans {
'A':'1',
'C':'2',
'G':'3',
'T':'4',
} 'A' 'A' '1' 'C' 'C' '2' 'G' 'G' '3' 'T' 'T' '4' def getChar(ch):
    return int(ch.translate(table)) getChar return int(ch.translate(table)) int(ch.translate(table)) int ch.translate(table) ch.translate ch translate table ch ch def h1(key):
    return key % M h1 return key % M key % M key M key key def h2(key):
    return 1 + (key % (M - 1)) h2 return 1 + (key % (M - 1)) 1 + (key % (M - 1)) 1 key % (M - 1) key M - 1 M 1 key key def insert(ch):
    key = getChar(ch)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] is None:
            H[h] = ch
            break
        else:
            i += 1 insert key = getChar(ch) key getChar(ch) getChar ch i = 0 i 0 while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] is None:
            H[h] = ch
            break
        else:
            i += 1 True h = (h1(key) + i * h2(key)) % M h (h1(key) + i * h2(key)) % M h1(key) + i * h2(key) h1(key) h1 key i * h2(key) i h2(key) h2 key M if H[h] is None:
            H[h] = ch
            break
        else:
            i += 1 H[h] is None H[h] H h None H[h] = ch H[h] H h ch break i += 1 i 1 ch ch def find(ch):
    key = getChar(ch)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == ch:
            return 1
        elif H[h] is None:
            return 0
        else:
            i += 1 find key = getChar(ch) key getChar(ch) getChar ch i = 0 i 0 while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == ch:
            return 1
        elif H[h] is None:
            return 0
        else:
            i += 1 True h = (h1(key) + i * h2(key)) % M h (h1(key) + i * h2(key)) % M h1(key) + i * h2(key) h1(key) h1 key i * h2(key) i h2(key) h2 key M if H[h] == ch:
            return 1
        elif H[h] is None:
            return 0
        else:
            i += 1 H[h] == ch H[h] H h ch return 1 1 elif H[h] is None:
            return 0
         H[h] is None H[h] H h None return 0 0 i += 1 i 1 ch ch for i in range(n):
    if com[i][0] == 'i':
        insert(ch[i])
    else:
        if find(ch[i]):
            print('yes')
        else:
            print('no') i range(n) range n if com[i][0] == 'i':
        insert(ch[i])
    else:
        if find(ch[i]):
            print('yes')
        else:
            print('no') com[i][0] == 'i' com[i][0] [i] com i 0 'i' insert(ch[i]) insert ch[i] ch i if find(ch[i]):
            print('yes')
        else:
            print('no') find(ch[i]) find ch[i] ch i print('yes') print 'yes' print('no') print 'no' def LI(): return list(map(int, sys.stdin.readline().rstrip().split())) def LI(): return list(map(int, sys.stdin.readline().rstrip().split())) LI NIL = -1 -1 NIL def h2(key):
    return 1 + (key % (M - 1)) def h2(key):
    return 1 + (key % (M - 1)) h2 com = [] [] com def insert(ch):
    key = getChar(ch)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] is None:
            H[h] = ch
            break
        else:
            i += 1 def insert(ch):
    key = getChar(ch)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] is None:
            H[h] = ch
            break
        else:
            i += 1 insert def LS(): return list(sys.stdin.readline().rstrip().split()) def LS(): return list(sys.stdin.readline().rstrip().split()) LS ch_ = input().split() input().split() ch_ H = [None] * M [None] * M H table = str.maketrans({
'A':'1',
'C':'2',
'G':'3',
'T':'4',
}) str.maketrans({
'A':'1',
'C':'2',
'G':'3',
'T':'4',
}) table def S(): return sys.stdin.readline().rstrip() def S(): return sys.stdin.readline().rstrip() S def find(ch):
    key = getChar(ch)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == ch:
            return 1
        elif H[h] is None:
            return 0
        else:
            i += 1 def find(ch):
    key = getChar(ch)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == ch:
            return 1
        elif H[h] is None:
            return 0
        else:
            i += 1 find com_, ch_ = input().split() input().split() com_ def getChar(ch):
    return int(ch.translate(table)) def getChar(ch):
    return int(ch.translate(table)) getChar def MI(): return map(int, sys.stdin.readline().rstrip().split()) def MI(): return map(int, sys.stdin.readline().rstrip().split()) MI M = 1046527 1046527 M def I(): return int(sys.stdin.readline().rstrip()) def I(): return int(sys.stdin.readline().rstrip()) I n = I() I() n def h1(key):
    return key % M def h1(key):
    return key % M h1 ch = [] [] ch
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

n = I()
M = 1046527
NIL = -1
H = [None] * M
com = []
ch = []

for i in range(n):
    com_, ch_ = input().split()
    com.append(com_)
    ch.append(ch_)


table = str.maketrans({
'A':'1',
'C':'2',
'G':'3',
'T':'4',
})


def getChar(ch):
    return int(ch.translate(table))

def h1(key):
    return key % M
def h2(key):
    return 1 + (key % (M - 1))

def insert(ch):
    key = getChar(ch)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] is None:
            H[h] = ch
            break
        else:
            i += 1

def find(ch):
    key = getChar(ch)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == ch:
            return 1
        elif H[h] is None:
            return 0
        else:
            i += 1


for i in range(n):
    if com[i][0] == 'i':
        insert(ch[i])
    else:
        if find(ch[i]):
            print('yes')
        else:
            print('no')
