import sys

#fin = open("test.txt", "r")
fin = sys.stdin

n = int(fin.readline())
d = {}

for i in range(n):
	op, str = fin.readline().split()
	if op == "insert":
		d[str] = 0
	else:
		if str in d:
			print("yes")
		else:
			print("no") import sys sys fin = sys.stdin fin sys.stdin sys stdin n = int(fin.readline()) n int(fin.readline()) int fin.readline() fin.readline fin readline d = {} d {} for i in range(n):
	op, str = fin.readline().split()
	if op == "insert":
		d[str] = 0
	else:
		if str in d:
			print("yes")
		else:
			print("no") i range(n) range n op, str = fin.readline().split() op fin.readline().split() fin.readline().split fin.readline() fin.readline fin readline split str if op == "insert":
		d[str] = 0
	else:
		if str in d:
			print("yes")
		else:
			print("no") op == "insert" op "insert" d[str] = 0 d[str] d str 0 if str in d:
			print("yes")
		else:
			print("no") str in d str d print("yes") print "yes" print("no") print "no" op, str = fin.readline().split() fin.readline().split() op fin = sys.stdin sys.stdin fin n = int(fin.readline()) int(fin.readline()) n str = fin.readline().split() fin.readline().split() str d = {} {} d
import sys

#fin = open("test.txt", "r")
fin = sys.stdin

n = int(fin.readline())
d = {}

for i in range(n):
	op, str = fin.readline().split()
	if op == "insert":
		d[str] = 0
	else:
		if str in d:
			print("yes")
		else:
			print("no")