cmd = []
d = set()

n = int(input())
for i in range(n):
    cmd.clear()
    cmd = input().split()
    if cmd[0] =='insert':
        d.add(cmd[1])
    else:
        if cmd[1] in d:
            print('yes')
        else:
            print('no') cmd = [] cmd [] d = set() d set() set n = int(input()) n int(input()) int input() input for i in range(n):
    cmd.clear()
    cmd = input().split()
    if cmd[0] =='insert':
        d.add(cmd[1])
    else:
        if cmd[1] in d:
            print('yes')
        else:
            print('no') i range(n) range n cmd.clear() cmd.clear cmd clear cmd = input().split() cmd input().split() ().split () input split if cmd[0] =='insert':
        d.add(cmd[1])
    else:
        if cmd[1] in d:
            print('yes')
        else:
            print('no') cmd[0] =='insert' cmd[0] cmd 0 'insert' d.add(cmd[1]) d.add d add cmd[1] cmd 1 if cmd[1] in d:
            print('yes')
        else:
            print('no') cmd[1] in d cmd[1] cmd 1 d print('yes') print 'yes' print('no') print 'no' d = set() set() d cmd = [] [] cmd n = int(input()) int(input()) n cmd = input().split() input().split() cmd
cmd = []
d = set()

n = int(input())
for i in range(n):
    cmd.clear()
    cmd = input().split()
    if cmd[0] =='insert':
        d.add(cmd[1])
    else:
        if cmd[1] in d:
            print('yes')
        else:
            print('no')
