n = int(input())
#n = int(lines.pop())

dictionary = dict()
for i in range(n):
	command,data = input().split()
	#command,data = lines.pop().split()
	if command == 'insert':
		dictionary[data] = 1
	else:
		if data in dictionary:
			print('yes')
		else:
			print('no') n = int(input()) n int(input()) int input() input dictionary = dict() dictionary dict() dict for i in range(n):
	command,data = input().split()
	#command,data = lines.pop().split()
	if command == 'insert':
		dictionary[data] = 1
	else:
		if data in dictionary:
			print('yes')
		else:
			print('no') i range(n) range n command,data = input().split() command input().split() ().split () input split data if command == 'insert':
		dictionary[data] = 1
	else:
		if data in dictionary:
			print('yes')
		else:
			print('no') command == 'insert' command 'insert' dictionary[data] = 1 dictionary[data] dictionary data 1 if data in dictionary:
			print('yes')
		else:
			print('no') data in dictionary data dictionary print('yes') print 'yes' print('no') print 'no' dictionary = dict() dict() dictionary command,data = input().split() input().split() command data = input().split() input().split() data n = int(input()) int(input()) n
n = int(input())
#n = int(lines.pop())

dictionary = dict()
for i in range(n):
	command,data = input().split()
	#command,data = lines.pop().split()
	if command == 'insert':
		dictionary[data] = 1
	else:
		if data in dictionary:
			print('yes')
		else:
			print('no')