import sys


def main():
    orders = sys.stdin.readlines()[1:]
    dna_set = set()
    for order in orders:
        command, dna = order.split(" ")
        if command == "insert":
            dna_set.add(dna)
        elif command == "find":
            if dna in dna_set:
                print("yes")
            else:
                print("no")


if __name__ == "__main__":
    main() import sys sys def main():
    orders = sys.stdin.readlines()[1:]
    dna_set = set()
    for order in orders:
        command, dna = order.split(" ")
        if command == "insert":
            dna_set.add(dna)
        elif command == "find":
            if dna in dna_set:
                print("yes")
            else:
                print("no") main orders = sys.stdin.readlines()[1:] orders sys.stdin.readlines()[1:] sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines 1: 1 dna_set = set() dna_set set() set for order in orders:
        command, dna = order.split(" ")
        if command == "insert":
            dna_set.add(dna)
        elif command == "find":
            if dna in dna_set:
                print("yes")
            else:
                print("no") order orders command, dna = order.split(" ") command order.split(" ") order.split order split " " dna if command == "insert":
            dna_set.add(dna)
        elif command == "find":
            if dna in dna_set:
                print("yes")
            else:
                print("no") command == "insert" command "insert" dna_set.add(dna) dna_set.add dna_set add dna elif command == "find":
            if dna in dna_set:
                print("yes")
            else:
                print("no") command == "find" command "find" if dna in dna_set:
                print("yes")
            else:
                print("no") dna in dna_set dna dna_set print("yes") print "yes" print("no") print "no" if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    orders = sys.stdin.readlines()[1:]
    dna_set = set()
    for order in orders:
        command, dna = order.split(" ")
        if command == "insert":
            dna_set.add(dna)
        elif command == "find":
            if dna in dna_set:
                print("yes")
            else:
                print("no") def main():
    orders = sys.stdin.readlines()[1:]
    dna_set = set()
    for order in orders:
        command, dna = order.split(" ")
        if command == "insert":
            dna_set.add(dna)
        elif command == "find":
            if dna in dna_set:
                print("yes")
            else:
                print("no") main
import sys


def main():
    orders = sys.stdin.readlines()[1:]
    dna_set = set()
    for order in orders:
        command, dna = order.split(" ")
        if command == "insert":
            dna_set.add(dna)
        elif command == "find":
            if dna in dna_set:
                print("yes")
            else:
                print("no")


if __name__ == "__main__":
    main()