n=int(input())
dict={}
for i in range(n):
    str=input()
    if str[0]=="i":
        dict.update({str[7:]:1})
    else:
        if str[5:] in dict:
            print("yes")
        else:
            print("no") n=int(input()) n int(input()) int input() input dict={} dict {} for i in range(n):
    str=input()
    if str[0]=="i":
        dict.update({str[7:]:1})
    else:
        if str[5:] in dict:
            print("yes")
        else:
            print("no") i range(n) range n str=input() str input() input if str[0]=="i":
        dict.update({str[7:]:1})
    else:
        if str[5:] in dict:
            print("yes")
        else:
            print("no") str[0]=="i" str[0] str 0 "i" dict.update({str[7:]:1}) dict.update dict update {str[7:]:1} str[7:] str[7:] str 7: 7 1 if str[5:] in dict:
            print("yes")
        else:
            print("no") str[5:] in dict str[5:] str 5: 5 dict print("yes") print "yes" print("no") print "no" n=int(input()) int(input()) n dict={} {} dict str=input() input() str
n=int(input())
dict={}
for i in range(n):
    str=input()
    if str[0]=="i":
        dict.update({str[7:]:1})
    else:
        if str[5:] in dict:
            print("yes")
        else:
            print("no")
