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

for i in rl:
    #c, s = i.split()
    if i[0] == 'i':
    #if c[0] == 'i':
        d[i[7:]] = 0
        #d[s] = 0
    else:
        if i[5:] in d:
        #if s in d:
            print('yes')
        else:
            print('no') import sys sys input() input rl = sys.stdin.readlines() rl sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines d = {} d {} for i in rl:
    #c, s = i.split()
    if i[0] == 'i':
    #if c[0] == 'i':
        d[i[7:]] = 0
        #d[s] = 0
    else:
        if i[5:] in d:
        #if s in d:
            print('yes')
        else:
            print('no') i rl if i[0] == 'i':
    #if c[0] == 'i':
        d[i[7:]] = 0
        #d[s] = 0
    else:
        if i[5:] in d:
        #if s in d:
            print('yes')
        else:
            print('no') i[0] == 'i' i[0] i 0 'i' d[i[7:]] = 0 d[i[7:]] d i[7:] i 7: 7 0 if i[5:] in d:
        #if s in d:
            print('yes')
        else:
            print('no') i[5:] in d i[5:] i 5: 5 d print('yes') print 'yes' print('no') print 'no' d = {} {} d rl = sys.stdin.readlines() sys.stdin.readlines() rl
import sys
input()
rl = sys.stdin.readlines()
d = {}

for i in rl:
    #c, s = i.split()
    if i[0] == 'i':
    #if c[0] == 'i':
        d[i[7:]] = 0
        #d[s] = 0
    else:
        if i[5:] in d:
        #if s in d:
            print('yes')
        else:
            print('no')