n = int(input())
d = {}
for i in range(n):
    cmd, string = input().split()
    if cmd == "insert":
        d[string] = True
    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):
    cmd, string = input().split()
    if cmd == "insert":
        d[string] = True
    else:
        try:
            if d[string]:
                print("yes")
        except:
            print("no") i range(n) range n cmd, string = input().split() cmd input().split() ().split () input split string if cmd == "insert":
        d[string] = True
    else:
        try:
            if d[string]:
                print("yes")
        except:
            print("no") cmd == "insert" cmd "insert" d[string] = True d[string] d string True 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" n = int(input()) int(input()) n string = input().split() input().split() string cmd, string = input().split() input().split() cmd d = {} {} d
n = int(input())
d = {}
for i in range(n):
    cmd, string = input().split()
    if cmd == "insert":
        d[string] = True
    else:
        try:
            if d[string]:
                print("yes")
        except:
            print("no")
