n = input()
a = set()

for x in xrange(n):
	(i, f) = map(str, raw_input().split())
	if i == "insert":
		a.add(f)
	else:
		if f in a:
			print "yes"
		else:
			print "no" n = input() n input() input a = set() a set() set for x in xrange(n):
	(i, f) = map(str, raw_input().split())
	if i == "insert":
		a.add(f)
	else:
		if f in a:
			print "yes"
		else:
			print "no" x xrange(n) xrange n (i, f) = map(str, raw_input().split()) (i, f) i f map(str, raw_input().split()) map str raw_input().split() ().split () raw_input split if i == "insert":
		a.add(f)
	else:
		if f in a:
			print "yes"
		else:
			print "no" i == "insert" i "insert" a.add(f) a.add a add f if f in a:
			print "yes"
		else:
			print "no" f in a f a print print a = set() set() a n = input() input() n
n = input()
a = set()

for x in xrange(n):
	(i, f) = map(str, raw_input().split())
	if i == "insert":
		a.add(f)
	else:
		if f in a:
			print "yes"
		else:
			print "no"