count=int(raw_input())
l=set()
for i in xrange(count):
	a,b=raw_input().split()
	if a=='insert':
		l.add(b)
	elif b in l:
		print 'yes'
	else:
		print 'no' count=int(raw_input()) count int(raw_input()) int raw_input() raw_input l=set() l set() set for i in xrange(count):
	a,b=raw_input().split()
	if a=='insert':
		l.add(b)
	elif b in l:
		print 'yes'
	else:
		print 'no' i xrange(count) xrange count a,b=raw_input().split() a raw_input().split() ().split () raw_input split b if a=='insert':
		l.add(b)
	elif b in l:
		print 'yes'
	else:
		print 'no' a=='insert' a 'insert' l.add(b) l.add l add b elif b in l:
		print 'yes'
	 b in l b l print print a,b=raw_input().split() raw_input().split() a b=raw_input().split() raw_input().split() b l=set() set() l count=int(raw_input()) int(raw_input()) count
count=int(raw_input())
l=set()
for i in xrange(count):
	a,b=raw_input().split()
	if a=='insert':
		l.add(b)
	elif b in l:
		print 'yes'
	else:
		print 'no'