N = int(input())

a = set([])
for i in range(N):
    S = input()
    if S[0] == "i":
        a.add(S[7:])
        #print("a",a)
    else:
        print("yes" if S[5:] in a else "no")
 N = int(input()) N int(input()) int input() input a = set([]) a set([]) set [] for i in range(N):
    S = input()
    if S[0] == "i":
        a.add(S[7:])
        #print("a",a)
    else:
        print("yes" if S[5:] in a else "no") i range(N) range N S = input() S input() input if S[0] == "i":
        a.add(S[7:])
        #print("a",a)
    else:
        print("yes" if S[5:] in a else "no") S[0] == "i" S[0] S 0 "i" a.add(S[7:]) a.add a add S[7:] S 7: 7 print("yes" if S[5:] in a else "no") print "yes" if S[5:] in a else "no" S[5:] in a S[5:] S 5: 5 a "yes" "no" a = set([]) set([]) a N = int(input()) int(input()) N S = input() input() S
N = int(input())

a = set([])
for i in range(N):
    S = input()
    if S[0] == "i":
        a.add(S[7:])
        #print("a",a)
    else:
        print("yes" if S[5:] in a else "no")

