# ALDS1_4_C.py
N = int(input())
dict = {}
for i in range(N):
    query, s = input().split()
    if query == "insert":
        dict[s] = True
    else:
        print('yes' if s in dict else 'no')
 N = int(input()) N int(input()) int input() input dict = {} dict {} for i in range(N):
    query, s = input().split()
    if query == "insert":
        dict[s] = True
    else:
        print('yes' if s in dict else 'no') i range(N) range N query, s = input().split() query input().split() ().split () input split s if query == "insert":
        dict[s] = True
    else:
        print('yes' if s in dict else 'no') query == "insert" query "insert" dict[s] = True dict[s] dict s True print('yes' if s in dict else 'no') print 'yes' if s in dict else 'no' s in dict s dict 'yes' 'no' query, s = input().split() input().split() query s = input().split() input().split() s N = int(input()) int(input()) N dict = {} {} dict
# ALDS1_4_C.py
N = int(input())
dict = {}
for i in range(N):
    query, s = input().split()
    if query == "insert":
        dict[s] = True
    else:
        print('yes' if s in dict else 'no')

