n = int(input())
o = {""}
for i in range(n):
    a = len(o)
    op, ob = map(str, input().split())
    if op == "find":
        o.add(ob)
        if len(o) > a:
            print("no")
            o.discard(ob)
        else:
            print("yes")
    else:
        o.add(ob) n = int(input()) n int(input()) int input() input o = {""} o {""} for i in range(n):
    a = len(o)
    op, ob = map(str, input().split())
    if op == "find":
        o.add(ob)
        if len(o) > a:
            print("no")
            o.discard(ob)
        else:
            print("yes")
    else:
        o.add(ob) i range(n) range n a = len(o) a len(o) len o op, ob = map(str, input().split()) op map(str, input().split()) map str input().split() ().split () input split ob if op == "find":
        o.add(ob)
        if len(o) > a:
            print("no")
            o.discard(ob)
        else:
            print("yes")
    else:
        o.add(ob) op == "find" op "find" o.add(ob) o.add o add ob if len(o) > a:
            print("no")
            o.discard(ob)
        else:
            print("yes")
     len(o) > a len(o) len o a print("no") print "no" o.discard(ob) o.discard o discard ob print("yes") print "yes" o.add(ob) o.add o add ob n = int(input()) int(input()) n a = len(o) len(o) a op, ob = map(str, input().split()) map(str, input().split()) op ob = map(str, input().split()) map(str, input().split()) ob o = {""} {""} o
n = int(input())
o = {""}
for i in range(n):
    a = len(o)
    op, ob = map(str, input().split())
    if op == "find":
        o.add(ob)
        if len(o) > a:
            print("no")
            o.discard(ob)
        else:
            print("yes")
    else:
        o.add(ob)
