import sys
input()
r = sys.stdin.readlines()
d = {}

for i in r:
    if i[0] == 'i':
        d[i[7:]] = 0
    else:
        print('yes' if i[5:] in d else 'no') import sys sys input() input r = sys.stdin.readlines() r sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines d = {} d {} for i in r:
    if i[0] == 'i':
        d[i[7:]] = 0
    else:
        print('yes' if i[5:] in d else 'no') i r if i[0] == 'i':
        d[i[7:]] = 0
    else:
        print('yes' if i[5:] in d else 'no') i[0] == 'i' i[0] i 0 'i' d[i[7:]] = 0 d[i[7:]] d i[7:] i 7: 7 0 print('yes' if i[5:] in d else 'no') print 'yes' if i[5:] in d else 'no' i[5:] in d i[5:] i 5: 5 d 'yes' 'no' r = sys.stdin.readlines() sys.stdin.readlines() r d = {} {} d
import sys
input()
r = sys.stdin.readlines()
d = {}

for i in r:
    if i[0] == 'i':
        d[i[7:]] = 0
    else:
        print('yes' if i[5:] in d else 'no')