# AOJ ALDS1_4_C Dictionary
# Python3 2018.7.3 bal4u

dic = {}
n = int(input())
for i in range(n):
	id, s = input().split()
	if id == "insert": dic[s] = 1
	else: print("yes" if s in dic else "no") dic = {} dic {} n = int(input()) n int(input()) int input() input for i in range(n):
	id, s = input().split()
	if id == "insert": dic[s] = 1
	else: print("yes" if s in dic else "no") i range(n) range n id, s = input().split() id input().split() ().split () input split s if id == "insert": dic[s] = 1
	else: print("yes" if s in dic else "no") id == "insert" id "insert" s = input().split() input().split() s dic = {} {} dic n = int(input()) int(input()) n id, s = input().split() input().split() id
# AOJ ALDS1_4_C Dictionary
# Python3 2018.7.3 bal4u

dic = {}
n = int(input())
for i in range(n):
	id, s = input().split()
	if id == "insert": dic[s] = 1
	else: print("yes" if s in dic else "no")
