from collections import deque
dictionary = set()
for making in range(int(input())) :
    action = input().split()
    if action[0] == 'insert' : dictionary.add(action[1])
    else : 
        if action[1] in dictionary : print('yes')
        else : print('no') from collections import deque dictionary = set() dictionary set() set for making in range(int(input())) :
    action = input().split()
    if action[0] == 'insert' : dictionary.add(action[1])
    else : 
        if action[1] in dictionary : print('yes')
        else : print('no') making range(int(input())) range int(input()) int input() input action = input().split() action input().split() ().split () input split if action[0] == 'insert' : dictionary.add(action[1])
    else : 
        if action[1] in dictionary : print('yes')
        else : print('no') action[0] == 'insert' action[0] action 0 'insert' if action[1] in dictionary : print('yes')
        else : print('no') action[1] in dictionary action[1] action 1 dictionary dictionary = set() set() dictionary action = input().split() input().split() action
from collections import deque
dictionary = set()
for making in range(int(input())) :
    action = input().split()
    if action[0] == 'insert' : dictionary.add(action[1])
    else : 
        if action[1] in dictionary : print('yes')
        else : print('no')