d={}
for _ in[0]*int(input()):
 c,g=input().split()
 if'i'==c[0]:d[g]=0
 else:print(['no','yes'][g in d]) d={} d {} for _ in[0]*int(input()):
 c,g=input().split()
 if'i'==c[0]:d[g]=0
 else:print(['no','yes'][g in d]) _ [0]*int(input()) [0] 0 int(input()) int input() input c,g=input().split() c input().split() ().split () input split g if'i'==c[0]:d[g]=0
 else:print(['no','yes'][g in d]) 'i'==c[0] 'i' c[0] c 0 d={} {} d g=input().split() input().split() g c,g=input().split() input().split() c
d={}
for _ in[0]*int(input()):
 c,g=input().split()
 if'i'==c[0]:d[g]=0
 else:print(['no','yes'][g in d])
