from typing import Dict


def main():
    n: int = int(input())
    d: Dict[str, bool] = {}

    for _ in range(n):
        command = input().split()
        if command[0] == "insert":
            d[f"{command[1]}"] = True
        else:
            if command[1] in d:
                print("yes")
            else:
                print("no")


if __name__ == "__main__":
    main()
 from typing import Dict def main():
    n: int = int(input())
    d: Dict[str, bool] = {}

    for _ in range(n):
        command = input().split()
        if command[0] == "insert":
            d[f"{command[1]}"] = True
        else:
            if command[1] in d:
                print("yes")
            else:
                print("no") main n: int = int(input()) n int(input()) int input() input d: Dict[str, bool] = {} d {} for _ in range(n):
        command = input().split()
        if command[0] == "insert":
            d[f"{command[1]}"] = True
        else:
            if command[1] in d:
                print("yes")
            else:
                print("no") _ range(n) range n command = input().split() command input().split() ().split () input split if command[0] == "insert":
            d[f"{command[1]}"] = True
        else:
            if command[1] in d:
                print("yes")
            else:
                print("no") command[0] == "insert" command[0] command 0 "insert" d[f"{command[1]}"] = True d[f"{command[1]}"] d f"{command[1]}" True if command[1] in d:
                print("yes")
            else:
                print("no") command[1] in d command[1] command 1 d print("yes") print "yes" print("no") print "no" if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n: int = int(input())
    d: Dict[str, bool] = {}

    for _ in range(n):
        command = input().split()
        if command[0] == "insert":
            d[f"{command[1]}"] = True
        else:
            if command[1] in d:
                print("yes")
            else:
                print("no") def main():
    n: int = int(input())
    d: Dict[str, bool] = {}

    for _ in range(n):
        command = input().split()
        if command[0] == "insert":
            d[f"{command[1]}"] = True
        else:
            if command[1] in d:
                print("yes")
            else:
                print("no") main
from typing import Dict


def main():
    n: int = int(input())
    d: Dict[str, bool] = {}

    for _ in range(n):
        command = input().split()
        if command[0] == "insert":
            d[f"{command[1]}"] = True
        else:
            if command[1] in d:
                print("yes")
            else:
                print("no")


if __name__ == "__main__":
    main()

