s = {0}
for i in [*open(0)][1:]:
    a, b = i.split()
    if a == "insert":
        s |= {b}
    else:
        print("yes" if b in s else "no") s = {0} s {0} for i in [*open(0)][1:]:
    a, b = i.split()
    if a == "insert":
        s |= {b}
    else:
        print("yes" if b in s else "no") i [*open(0)][1:] [*open(0)] *open(0) open(0) open 0 1: 1 a, b = i.split() a i.split() i.split i split b if a == "insert":
        s |= {b}
    else:
        print("yes" if b in s else "no") a == "insert" a "insert" s |= {b} s {b} print("yes" if b in s else "no") print "yes" if b in s else "no" b in s b s "yes" "no" s = {0} {0} s b = i.split() i.split() b s |= {b} {b} s a, b = i.split() i.split() a
s = {0}
for i in [*open(0)][1:]:
    a, b = i.split()
    if a == "insert":
        s |= {b}
    else:
        print("yes" if b in s else "no")
