# coding: utf-8
# ハッシュ（Dictパターン）

hash_list = {}

if __name__ == "__main__":
    n = int(input())

    for _ in range(n):
        command, arg = input().split()

        if command == 'insert':
            hash_list[arg] = 1
        else:
            print('yes' if arg in hash_list else 'no') hash_list = {} hash_list {} if __name__ == "__main__":
    n = int(input())

    for _ in range(n):
        command, arg = input().split()

        if command == 'insert':
            hash_list[arg] = 1
        else:
            print('yes' if arg in hash_list else 'no') __name__ == "__main__" __name__ "__main__" n = int(input()) n int(input()) int input() input for _ in range(n):
        command, arg = input().split()

        if command == 'insert':
            hash_list[arg] = 1
        else:
            print('yes' if arg in hash_list else 'no') _ range(n) range n command, arg = input().split() command input().split() ().split () input split arg if command == 'insert':
            hash_list[arg] = 1
        else:
            print('yes' if arg in hash_list else 'no') command == 'insert' command 'insert' hash_list[arg] = 1 hash_list[arg] hash_list arg 1 print('yes' if arg in hash_list else 'no') print 'yes' if arg in hash_list else 'no' arg in hash_list arg hash_list 'yes' 'no' n = int(input()) int(input()) n hash_list = {} {} hash_list command, arg = input().split() input().split() command arg = input().split() input().split() arg
# coding: utf-8
# ハッシュ（Dictパターン）

hash_list = {}

if __name__ == "__main__":
    n = int(input())

    for _ in range(n):
        command, arg = input().split()

        if command == 'insert':
            hash_list[arg] = 1
        else:
            print('yes' if arg in hash_list else 'no')
