dic = set()
n = int(input())
for i in range(n):
	s = input()
	if s[0] == 'i': 
	    dic.add(s[7:])
	    
	else: print("yes" if s[5:] in dic else "no") dic = set() dic set() set n = int(input()) n int(input()) int input() input for i in range(n):
	s = input()
	if s[0] == 'i': 
	    dic.add(s[7:])
	    
	else: print("yes" if s[5:] in dic else "no") i range(n) range n s = input() s input() input if s[0] == 'i': 
	    dic.add(s[7:])
	    
	else: print("yes" if s[5:] in dic else "no") s[0] == 'i' s[0] s 0 'i' dic.add(s[7:]) dic.add dic add s[7:] s 7: 7 n = int(input()) int(input()) n s = input() input() s dic = set() set() dic
dic = set()
n = int(input())
for i in range(n):
	s = input()
	if s[0] == 'i': 
	    dic.add(s[7:])
	    
	else: print("yes" if s[5:] in dic else "no")
