from collections import deque

D = set()
N = int(input())

for i in range(N):
	c, s = input().split()
	if c == "insert":
		D.add(s)
	elif c == "find":
		if (s in D):
			print("yes")
		else:
			print("no") from collections import deque D = set() D set() set N = int(input()) N int(input()) int input() input for i in range(N):
	c, s = input().split()
	if c == "insert":
		D.add(s)
	elif c == "find":
		if (s in D):
			print("yes")
		else:
			print("no") i range(N) range N c, s = input().split() c input().split() ().split () input split s if c == "insert":
		D.add(s)
	elif c == "find":
		if (s in D):
			print("yes")
		else:
			print("no") c == "insert" c "insert" D.add(s) D.add D add s elif c == "find":
		if (s in D):
			print("yes")
		else:
			print("no") c == "find" c "find" if (s in D):
			print("yes")
		else:
			print("no") s in D s D print("yes") print "yes" print("no") print "no" c, s = input().split() input().split() c N = int(input()) int(input()) N D = set() set() D s = input().split() input().split() s
from collections import deque

D = set()
N = int(input())

for i in range(N):
	c, s = input().split()
	if c == "insert":
		D.add(s)
	elif c == "find":
		if (s in D):
			print("yes")
		else:
			print("no")