n = input()
table =	set()

for i in range(n):
    com	= raw_input().split()
    if(com[0][0] == "i"):
	table.add(com[1])
    else:
	if com[1] in table:
            print("yes")
	else:
            print("no") n = input() n input() input table =	set() table set() set for i in range(n):
    com	= raw_input().split()
    if(com[0][0] == "i"):
	table.add(com[1])
    else:
	if com[1] in table:
            print("yes")
	else:
            print("no") i range(n) range n com	= raw_input().split() com raw_input().split() ().split () raw_input split if(com[0][0] == "i"):
	table.add(com[1])
    else:
	if com[1] in table:
            print("yes")
	else:
            print("no") com[0][0] == "i" com[0][0] [0] com 0 0 "i" table.add(com[1]) table.add table add com[1] com 1 if com[1] in table:
            print("yes")
	else:
            print("no") com[1] in table com[1] com 1 table print("yes") print "yes" print("no") print "no" n = input() input() n com	= raw_input().split() raw_input().split() com table =	set() set() table
n = input()
table =	set()

for i in range(n):
    com	= raw_input().split()
    if(com[0][0] == "i"):
	table.add(com[1])
    else:
	if com[1] in table:
            print("yes")
	else:
            print("no")