def main():
    dictionary = set()
    for _ in range(int(input())):
        command = input().split()
        if command[0] == 'insert':
            dictionary.add(command[1])
        else:
            print('yes' if command[1] in dictionary else 'no')


if __name__ == '__main__':
    main()
 def main():
    dictionary = set()
    for _ in range(int(input())):
        command = input().split()
        if command[0] == 'insert':
            dictionary.add(command[1])
        else:
            print('yes' if command[1] in dictionary else 'no') main dictionary = set() dictionary set() set for _ in range(int(input())):
        command = input().split()
        if command[0] == 'insert':
            dictionary.add(command[1])
        else:
            print('yes' if command[1] in dictionary else 'no') _ range(int(input())) range int(input()) int input() input command = input().split() command input().split() ().split () input split if command[0] == 'insert':
            dictionary.add(command[1])
        else:
            print('yes' if command[1] in dictionary else 'no') command[0] == 'insert' command[0] command 0 'insert' dictionary.add(command[1]) dictionary.add dictionary add command[1] command 1 print('yes' if command[1] in dictionary else 'no') print 'yes' if command[1] in dictionary else 'no' command[1] in dictionary command[1] command 1 dictionary 'yes' 'no' if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    dictionary = set()
    for _ in range(int(input())):
        command = input().split()
        if command[0] == 'insert':
            dictionary.add(command[1])
        else:
            print('yes' if command[1] in dictionary else 'no') def main():
    dictionary = set()
    for _ in range(int(input())):
        command = input().split()
        if command[0] == 'insert':
            dictionary.add(command[1])
        else:
            print('yes' if command[1] in dictionary else 'no') main
def main():
    dictionary = set()
    for _ in range(int(input())):
        command = input().split()
        if command[0] == 'insert':
            dictionary.add(command[1])
        else:
            print('yes' if command[1] in dictionary else 'no')


if __name__ == '__main__':
    main()

