n = int(raw_input())
dic = {}

for i in xrange(n):
	line = raw_input().split()
	cmd = line[0]
	ope = line[1]
	if cmd == "insert":
		dic[ope] = 1
	else:
		try:
			dic[ope] == 1
		except:
			print("no")
		else:
			print("yes") n = int(raw_input()) n int(raw_input()) int raw_input() raw_input dic = {} dic {} for i in xrange(n):
	line = raw_input().split()
	cmd = line[0]
	ope = line[1]
	if cmd == "insert":
		dic[ope] = 1
	else:
		try:
			dic[ope] == 1
		except:
			print("no")
		else:
			print("yes") i xrange(n) xrange n line = raw_input().split() line raw_input().split() ().split () raw_input split cmd = line[0] cmd line[0] line 0 ope = line[1] ope line[1] line 1 if cmd == "insert":
		dic[ope] = 1
	else:
		try:
			dic[ope] == 1
		except:
			print("no")
		else:
			print("yes") cmd == "insert" cmd "insert" dic[ope] = 1 dic[ope] dic ope 1 try:
			dic[ope] == 1
		except:
			print("no")
		else:
			print("yes") except:
			print("no")
		 print("no") print "no" dic[ope] == 1 dic[ope] dic ope 1 print("yes") print "yes" line = raw_input().split() raw_input().split() line cmd = line[0] line[0] cmd n = int(raw_input()) int(raw_input()) n dic = {} {} dic ope = line[1] line[1] ope
n = int(raw_input())
dic = {}

for i in xrange(n):
	line = raw_input().split()
	cmd = line[0]
	ope = line[1]
	if cmd == "insert":
		dic[ope] = 1
	else:
		try:
			dic[ope] == 1
		except:
			print("no")
		else:
			print("yes")