import time

n = int(input())
#t1 = time.time()

S = set()
for i in range(0,n):
	lst = list(input().split())
	if lst[0] == 'insert':
		S.add(lst[1])
	elif lst[0] == 'find':
		if lst[1] in S:
			print('yes')
		else:
			print('no')

#S = []
#for i in range(0,n):
#	lst = list(input().split())
#	if lst[0] == 'insert':
#		S.append(lst[1])
#	elif lst[0] == 'find':
#		if S.count(lst[1]) != 0:
#			print('yes')
#		else:
#			print('no')

#t2 = time.time()
#elapsed = t2-t1
#print('経過時間:{0}'.format(elapsed)) import time time n = int(input()) n int(input()) int input() input S = set() S set() set for i in range(0,n):
	lst = list(input().split())
	if lst[0] == 'insert':
		S.add(lst[1])
	elif lst[0] == 'find':
		if lst[1] in S:
			print('yes')
		else:
			print('no')

#S = []
#for i in range(0,n):
#	lst = list(input().split())
#	if lst[0] == 'insert':
#		S.append(lst[1])
#	elif lst[0] == 'find':
#		if S.count(lst[1]) != 0:
#			print('yes')
#		else:
#			print('no')

#t2 = time.time()
#elapsed = t2-t1
#print('経過時間:{0}'.format(elapsed)) i range(0,n) range 0 n lst = list(input().split()) lst list(input().split()) list input().split() ().split () input split if lst[0] == 'insert':
		S.add(lst[1])
	elif lst[0] == 'find':
		if lst[1] in S:
			print('yes')
		else:
			print('no')

#S = []
#for i in range(0,n):
#	lst = list(input().split())
#	if lst[0] == 'insert':
#		S.append(lst[1])
#	elif lst[0] == 'find':
#		if S.count(lst[1]) != 0:
#			print('yes')
#		else:
#			print('no')

#t2 = time.time()
#elapsed = t2-t1
#print('経過時間:{0}'.format(elapsed)) lst[0] == 'insert' lst[0] lst 0 'insert' S.add(lst[1]) S.add S add lst[1] lst 1 elif lst[0] == 'find':
		if lst[1] in S:
			print('yes')
		else:
			print('no')

#S = []
#for i in range(0,n):
#	lst = list(input().split())
#	if lst[0] == 'insert':
#		S.append(lst[1])
#	elif lst[0] == 'find':
#		if S.count(lst[1]) != 0:
#			print('yes')
#		else:
#			print('no')

#t2 = time.time()
#elapsed = t2-t1
#print('経過時間:{0}'.format(elapsed)) lst[0] == 'find' lst[0] lst 0 'find' if lst[1] in S:
			print('yes')
		else:
			print('no')

#S = []
#for i in range(0,n):
#	lst = list(input().split())
#	if lst[0] == 'insert':
#		S.append(lst[1])
#	elif lst[0] == 'find':
#		if S.count(lst[1]) != 0:
#			print('yes')
#		else:
#			print('no')

#t2 = time.time()
#elapsed = t2-t1
#print('経過時間:{0}'.format(elapsed)) lst[1] in S lst[1] lst 1 S print('yes') print 'yes' print('no') print 'no' n = int(input()) int(input()) n S = set() set() S lst = list(input().split()) list(input().split()) lst
import time

n = int(input())
#t1 = time.time()

S = set()
for i in range(0,n):
	lst = list(input().split())
	if lst[0] == 'insert':
		S.add(lst[1])
	elif lst[0] == 'find':
		if lst[1] in S:
			print('yes')
		else:
			print('no')

#S = []
#for i in range(0,n):
#	lst = list(input().split())
#	if lst[0] == 'insert':
#		S.append(lst[1])
#	elif lst[0] == 'find':
#		if S.count(lst[1]) != 0:
#			print('yes')
#		else:
#			print('no')

#t2 = time.time()
#elapsed = t2-t1
#print('経過時間:{0}'.format(elapsed))
