n = int(input())
dict = set()
for _ in range(n):
    c, s = input().split()
    if c == 'insert':
        dict.add(s)
    else:
        print(('no', 'yes')[s in dict])


 n = int(input()) n int(input()) int input() input dict = set() dict set() set for _ in range(n):
    c, s = input().split()
    if c == 'insert':
        dict.add(s)
    else:
        print(('no', 'yes')[s in dict]) _ range(n) range n c, s = input().split() c input().split() ().split () input split s if c == 'insert':
        dict.add(s)
    else:
        print(('no', 'yes')[s in dict]) c == 'insert' c 'insert' dict.add(s) dict.add dict add s print(('no', 'yes')[s in dict]) print ('no', 'yes')[s in dict] ('no', 'yes') 'no' 'yes' s in dict s dict s = input().split() input().split() s dict = set() set() dict n = int(input()) int(input()) n c, s = input().split() input().split() c
n = int(input())
dict = set()
for _ in range(n):
    c, s = input().split()
    if c == 'insert':
        dict.add(s)
    else:
        print(('no', 'yes')[s in dict])



