def main():
    n = int(input())
    operation = [input().split() for _ in range(n)]
    dictionary = {}
    
    for command, char in operation:
        if command == "insert":
            dictionary[char] = True
        elif command == "find":
            try:
                if dictionary[char]:
                    print("yes")
            except KeyError:
                print("no")
    return


if __name__ == "__main__":
    main()
 def main():
    n = int(input())
    operation = [input().split() for _ in range(n)]
    dictionary = {}
    
    for command, char in operation:
        if command == "insert":
            dictionary[char] = True
        elif command == "find":
            try:
                if dictionary[char]:
                    print("yes")
            except KeyError:
                print("no")
    return main n = int(input()) n int(input()) int input() input input().split() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) input().split() ().split () input split operation = [input().split() for _ in range(n)] operation [input().split() for _ in range(n)] dictionary = {} dictionary {} for command, char in operation:
        if command == "insert":
            dictionary[char] = True
        elif command == "find":
            try:
                if dictionary[char]:
                    print("yes")
            except KeyError:
                print("no")
     command char operation if command == "insert":
            dictionary[char] = True
        elif command == "find":
            try:
                if dictionary[char]:
                    print("yes")
            except KeyError:
                print("no")
     command == "insert" command "insert" dictionary[char] = True dictionary[char] dictionary char True elif command == "find":
            try:
                if dictionary[char]:
                    print("yes")
            except KeyError:
                print("no")
     command == "find" command "find" try:
                if dictionary[char]:
                    print("yes")
            except KeyError:
                print("no")
     except KeyError:
                print("no")
     print("no") print "no" if dictionary[char]:
                    print("yes")
             dictionary[char] dictionary char print("yes") print "yes" return if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n = int(input())
    operation = [input().split() for _ in range(n)]
    dictionary = {}
    
    for command, char in operation:
        if command == "insert":
            dictionary[char] = True
        elif command == "find":
            try:
                if dictionary[char]:
                    print("yes")
            except KeyError:
                print("no")
    return def main():
    n = int(input())
    operation = [input().split() for _ in range(n)]
    dictionary = {}
    
    for command, char in operation:
        if command == "insert":
            dictionary[char] = True
        elif command == "find":
            try:
                if dictionary[char]:
                    print("yes")
            except KeyError:
                print("no")
    return main
def main():
    n = int(input())
    operation = [input().split() for _ in range(n)]
    dictionary = {}
    
    for command, char in operation:
        if command == "insert":
            dictionary[char] = True
        elif command == "find":
            try:
                if dictionary[char]:
                    print("yes")
            except KeyError:
                print("no")
    return


if __name__ == "__main__":
    main()

