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

	for i in range(n):
		command, value = input().split()
		if command == 'insert':
			s.add(value)
		elif command == 'find':
			if value in s:
				print('yes')
			else:
				print('no')

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

	for i in range(n):
		command, value = input().split()
		if command == 'insert':
			s.add(value)
		elif command == 'find':
			if value in s:
				print('yes')
			else:
				print('no') dictionary n = int(input()) n int(input()) int input() input s = set() s set() set for i in range(n):
		command, value = input().split()
		if command == 'insert':
			s.add(value)
		elif command == 'find':
			if value in s:
				print('yes')
			else:
				print('no') i range(n) range n command, value = input().split() command input().split() ().split () input split value if command == 'insert':
			s.add(value)
		elif command == 'find':
			if value in s:
				print('yes')
			else:
				print('no') command == 'insert' command 'insert' s.add(value) s.add s add value elif command == 'find':
			if value in s:
				print('yes')
			else:
				print('no') command == 'find' command 'find' if value in s:
				print('yes')
			else:
				print('no') value in s value s print('yes') print 'yes' print('no') print 'no' if __name__ == '__main__':
	dictionary() __name__ == '__main__' __name__ '__main__' dictionary() dictionary def dictionary():
	n = int(input())
	s = set()

	for i in range(n):
		command, value = input().split()
		if command == 'insert':
			s.add(value)
		elif command == 'find':
			if value in s:
				print('yes')
			else:
				print('no') def dictionary():
	n = int(input())
	s = set()

	for i in range(n):
		command, value = input().split()
		if command == 'insert':
			s.add(value)
		elif command == 'find':
			if value in s:
				print('yes')
			else:
				print('no') dictionary
def dictionary():
	n = int(input())
	s = set()

	for i in range(n):
		command, value = input().split()
		if command == 'insert':
			s.add(value)
		elif command == 'find':
			if value in s:
				print('yes')
			else:
				print('no')

if __name__ == '__main__':
	dictionary()