n = int(input())
d = set()
for _ in range(n):
    command = input()
    if 'i' == command[0]:
        _, word = command.split()
        d.add(word)
    else:
        _, word = command.split()
        print('yes' if word in d else 'no') n = int(input()) n int(input()) int input() input d = set() d set() set for _ in range(n):
    command = input()
    if 'i' == command[0]:
        _, word = command.split()
        d.add(word)
    else:
        _, word = command.split()
        print('yes' if word in d else 'no') _ range(n) range n command = input() command input() input if 'i' == command[0]:
        _, word = command.split()
        d.add(word)
    else:
        _, word = command.split()
        print('yes' if word in d else 'no') 'i' == command[0] 'i' command[0] command 0 _, word = command.split() _ command.split() command.split command split word d.add(word) d.add d add word _, word = command.split() _ command.split() command.split command split word print('yes' if word in d else 'no') print 'yes' if word in d else 'no' word in d word d 'yes' 'no' _, word = command.split() command.split() _ word = command.split() command.split() word word = command.split() command.split() word command = input() input() command _, word = command.split() command.split() _ n = int(input()) int(input()) n d = set() set() d
n = int(input())
d = set()
for _ in range(n):
    command = input()
    if 'i' == command[0]:
        _, word = command.split()
        d.add(word)
    else:
        _, word = command.split()
        print('yes' if word in d else 'no')