n=int(input())
D=set()
for i in range(n):
    command,str_=input().split()
    if command=='insert':
        D.add(str_)
    elif command=='find':
        if str_ in D:
            print('yes')
        else:
            print('no') n=int(input()) n int(input()) int input() input D=set() D set() set for i in range(n):
    command,str_=input().split()
    if command=='insert':
        D.add(str_)
    elif command=='find':
        if str_ in D:
            print('yes')
        else:
            print('no') i range(n) range n command,str_=input().split() command input().split() ().split () input split str_ if command=='insert':
        D.add(str_)
    elif command=='find':
        if str_ in D:
            print('yes')
        else:
            print('no') command=='insert' command 'insert' D.add(str_) D.add D add str_ elif command=='find':
        if str_ in D:
            print('yes')
        else:
            print('no') command=='find' command 'find' if str_ in D:
            print('yes')
        else:
            print('no') str_ in D str_ D print('yes') print 'yes' print('no') print 'no' str_=input().split() input().split() str_ n=int(input()) int(input()) n command,str_=input().split() input().split() command D=set() set() D
n=int(input())
D=set()
for i in range(n):
    command,str_=input().split()
    if command=='insert':
        D.add(str_)
    elif command=='find':
        if str_ in D:
            print('yes')
        else:
            print('no')
