import sys
#from collections import ChainMap
input()
rp = sys.stdin.readlines()
cm = {}#ChainMap()

for i in rp:
    if i[0] == 'i':
        cm[i[7:]] = 0
    else:
        if i[5:] in cm:
            print('yes')
        else:
            print('no') import sys sys input() input rp = sys.stdin.readlines() rp sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines cm = {} cm {} for i in rp:
    if i[0] == 'i':
        cm[i[7:]] = 0
    else:
        if i[5:] in cm:
            print('yes')
        else:
            print('no') i rp if i[0] == 'i':
        cm[i[7:]] = 0
    else:
        if i[5:] in cm:
            print('yes')
        else:
            print('no') i[0] == 'i' i[0] i 0 'i' cm[i[7:]] = 0 cm[i[7:]] cm i[7:] i 7: 7 0 if i[5:] in cm:
            print('yes')
        else:
            print('no') i[5:] in cm i[5:] i 5: 5 cm print('yes') print 'yes' print('no') print 'no' rp = sys.stdin.readlines() sys.stdin.readlines() rp cm = {} {} cm
import sys
#from collections import ChainMap
input()
rp = sys.stdin.readlines()
cm = {}#ChainMap()

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