n = int(input())

d = {}
for i in range(n):
    order,string = input().split()
    if order == "insert":
        d[string] = 1
    else:
        try:
            if d[string] :
                print("yes")
        except:
            print("no") n = int(input()) n int(input()) int input() input d = {} d {} for i in range(n):
    order,string = input().split()
    if order == "insert":
        d[string] = 1
    else:
        try:
            if d[string] :
                print("yes")
        except:
            print("no") i range(n) range n order,string = input().split() order input().split() ().split () input split string if order == "insert":
        d[string] = 1
    else:
        try:
            if d[string] :
                print("yes")
        except:
            print("no") order == "insert" order "insert" d[string] = 1 d[string] d string 1 try:
            if d[string] :
                print("yes")
        except:
            print("no") except:
            print("no") print("no") print "no" if d[string] :
                print("yes")
         d[string] d string print("yes") print "yes" string = input().split() input().split() string n = int(input()) int(input()) n d = {} {} d order,string = input().split() input().split() order
n = int(input())

d = {}
for i in range(n):
    order,string = input().split()
    if order == "insert":
        d[string] = 1
    else:
        try:
            if d[string] :
                print("yes")
        except:
            print("no")
