
n = int(input())
d = set()
for i in range(n):
    x = input()
    if x[0] == "i":
        d.add(x[7:])
    else :
        if(x[5:] in d) : print("yes")
        else : print("no")
 n = int(input()) n int(input()) int input() input d = set() d set() set for i in range(n):
    x = input()
    if x[0] == "i":
        d.add(x[7:])
    else :
        if(x[5:] in d) : print("yes")
        else : print("no") i range(n) range n x = input() x input() input if x[0] == "i":
        d.add(x[7:])
    else :
        if(x[5:] in d) : print("yes")
        else : print("no") x[0] == "i" x[0] x 0 "i" d.add(x[7:]) d.add d add x[7:] x 7: 7 if(x[5:] in d) : print("yes")
        else : print("no") x[5:] in d x[5:] x 5: 5 d n = int(input()) int(input()) n d = set() set() d x = input() input() x

n = int(input())
d = set()
for i in range(n):
    x = input()
    if x[0] == "i":
        d.add(x[7:])
    else :
        if(x[5:] in d) : print("yes")
        else : print("no")

