if __name__ == '__main__':
	n = int(input())

	dic = set()

	for i in range(n):
		Cmd, Key = input().split()
		if Cmd == "insert":
			dic.add(Key)
		else:
			if Key in dic:
				print("yes")
			else:
				print("no") if __name__ == '__main__':
	n = int(input())

	dic = set()

	for i in range(n):
		Cmd, Key = input().split()
		if Cmd == "insert":
			dic.add(Key)
		else:
			if Key in dic:
				print("yes")
			else:
				print("no") __name__ == '__main__' __name__ '__main__' n = int(input()) n int(input()) int input() input dic = set() dic set() set for i in range(n):
		Cmd, Key = input().split()
		if Cmd == "insert":
			dic.add(Key)
		else:
			if Key in dic:
				print("yes")
			else:
				print("no") i range(n) range n Cmd, Key = input().split() Cmd input().split() ().split () input split Key if Cmd == "insert":
			dic.add(Key)
		else:
			if Key in dic:
				print("yes")
			else:
				print("no") Cmd == "insert" Cmd "insert" dic.add(Key) dic.add dic add Key if Key in dic:
				print("yes")
			else:
				print("no") Key in dic Key dic print("yes") print "yes" print("no") print "no" Cmd, Key = input().split() input().split() Cmd dic = set() set() dic Key = input().split() input().split() Key n = int(input()) int(input()) n
if __name__ == '__main__':
	n = int(input())

	dic = set()

	for i in range(n):
		Cmd, Key = input().split()
		if Cmd == "insert":
			dic.add(Key)
		else:
			if Key in dic:
				print("yes")
			else:
				print("no")