def main():
	n = int(input())
	dictionary = set()

	for _ in range(n):
		order, code = input().split()
		if order == 'insert':
			dictionary.add(code)
		elif order == 'find':
			if code in dictionary:
				print('yes')
			else:
				print('no')
		else:
			raise Exception('InputError')

if __name__ == '__main__':
	main() def main():
	n = int(input())
	dictionary = set()

	for _ in range(n):
		order, code = input().split()
		if order == 'insert':
			dictionary.add(code)
		elif order == 'find':
			if code in dictionary:
				print('yes')
			else:
				print('no')
		else:
			raise Exception('InputError') main n = int(input()) n int(input()) int input() input dictionary = set() dictionary set() set for _ in range(n):
		order, code = input().split()
		if order == 'insert':
			dictionary.add(code)
		elif order == 'find':
			if code in dictionary:
				print('yes')
			else:
				print('no')
		else:
			raise Exception('InputError') _ range(n) range n order, code = input().split() order input().split() ().split () input split code if order == 'insert':
			dictionary.add(code)
		elif order == 'find':
			if code in dictionary:
				print('yes')
			else:
				print('no')
		else:
			raise Exception('InputError') order == 'insert' order 'insert' dictionary.add(code) dictionary.add dictionary add code elif order == 'find':
			if code in dictionary:
				print('yes')
			else:
				print('no')
		 order == 'find' order 'find' if code in dictionary:
				print('yes')
			else:
				print('no')
		 code in dictionary code dictionary print('yes') print 'yes' print('no') print 'no' raise Exception('InputError') Exception('InputError') Exception 'InputError' if __name__ == '__main__':
	main() __name__ == '__main__' __name__ '__main__' main() main def main():
	n = int(input())
	dictionary = set()

	for _ in range(n):
		order, code = input().split()
		if order == 'insert':
			dictionary.add(code)
		elif order == 'find':
			if code in dictionary:
				print('yes')
			else:
				print('no')
		else:
			raise Exception('InputError') def main():
	n = int(input())
	dictionary = set()

	for _ in range(n):
		order, code = input().split()
		if order == 'insert':
			dictionary.add(code)
		elif order == 'find':
			if code in dictionary:
				print('yes')
			else:
				print('no')
		else:
			raise Exception('InputError') main
def main():
	n = int(input())
	dictionary = set()

	for _ in range(n):
		order, code = input().split()
		if order == 'insert':
			dictionary.add(code)
		elif order == 'find':
			if code in dictionary:
				print('yes')
			else:
				print('no')
		else:
			raise Exception('InputError')

if __name__ == '__main__':
	main()