#他の方の解答を参考にさせていただきました。
dic = {}
n = int(input())
for i in range(n):
	s = input()
	if s[0] == 'i': dic[s[7:]] = "a"
	else: print("yes" if s[5:] in dic else "no") dic = {} dic {} n = int(input()) n int(input()) int input() input for i in range(n):
	s = input()
	if s[0] == 'i': dic[s[7:]] = "a"
	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[s[7:]] = "a"
	else: print("yes" if s[5:] in dic else "no") s[0] == 'i' s[0] s 0 'i' s = input() input() s dic = {} {} dic n = int(input()) int(input()) n
#他の方の解答を参考にさせていただきました。
dic = {}
n = int(input())
for i in range(n):
	s = input()
	if s[0] == 'i': dic[s[7:]] = "a"
	else: print("yes" if s[5:] in dic else "no")
