n=int(input())
dic={}
a=[]
b=[]
for i in range(n):
	tmp1,tmp2=input().split()
	a.append(tmp1)
	b.append(tmp2)

for i in range(n):
	if a[i]=='insert':
		dic[b[i]]=1
	else:
		if b[i] in dic:
			print("yes")
		else:
			print("no") n=int(input()) n int(input()) int input() input dic={} dic {} a=[] a [] b=[] b [] for i in range(n):
	tmp1,tmp2=input().split()
	a.append(tmp1)
	b.append(tmp2) i range(n) range n tmp1,tmp2=input().split() tmp1 input().split() ().split () input split tmp2 a.append(tmp1) a.append a append tmp1 b.append(tmp2) b.append b append tmp2 for i in range(n):
	if a[i]=='insert':
		dic[b[i]]=1
	else:
		if b[i] in dic:
			print("yes")
		else:
			print("no") i range(n) range n if a[i]=='insert':
		dic[b[i]]=1
	else:
		if b[i] in dic:
			print("yes")
		else:
			print("no") a[i]=='insert' a[i] a i 'insert' dic[b[i]]=1 dic[b[i]] dic b[i] b i 1 if b[i] in dic:
			print("yes")
		else:
			print("no") b[i] in dic b[i] b i dic print("yes") print "yes" print("no") print "no" dic={} {} dic tmp2=input().split() input().split() tmp2 tmp1,tmp2=input().split() input().split() tmp1 a=[] [] a n=int(input()) int(input()) n b=[] [] b
n=int(input())
dic={}
a=[]
b=[]
for i in range(n):
	tmp1,tmp2=input().split()
	a.append(tmp1)
	b.append(tmp2)

for i in range(n):
	if a[i]=='insert':
		dic[b[i]]=1
	else:
		if b[i] in dic:
			print("yes")
		else:
			print("no")
