def ALDS1_4C():
    D = {}
    for i in range(int(input())):
        cmd, key = input().split()
        if cmd == 'insert':
            D[key]='yes'
        else:
            print(D.get(key, 'no'))

if __name__ == '__main__':
    ALDS1_4C() def ALDS1_4C():
    D = {}
    for i in range(int(input())):
        cmd, key = input().split()
        if cmd == 'insert':
            D[key]='yes'
        else:
            print(D.get(key, 'no')) ALDS1_4C D = {} D {} for i in range(int(input())):
        cmd, key = input().split()
        if cmd == 'insert':
            D[key]='yes'
        else:
            print(D.get(key, 'no')) i range(int(input())) range int(input()) int input() input cmd, key = input().split() cmd input().split() ().split () input split key if cmd == 'insert':
            D[key]='yes'
        else:
            print(D.get(key, 'no')) cmd == 'insert' cmd 'insert' D[key]='yes' D[key] D key 'yes' print(D.get(key, 'no')) print D.get(key, 'no') D.get D get key 'no' if __name__ == '__main__':
    ALDS1_4C() __name__ == '__main__' __name__ '__main__' ALDS1_4C() ALDS1_4C def ALDS1_4C():
    D = {}
    for i in range(int(input())):
        cmd, key = input().split()
        if cmd == 'insert':
            D[key]='yes'
        else:
            print(D.get(key, 'no')) def ALDS1_4C():
    D = {}
    for i in range(int(input())):
        cmd, key = input().split()
        if cmd == 'insert':
            D[key]='yes'
        else:
            print(D.get(key, 'no')) ALDS1_4C
def ALDS1_4C():
    D = {}
    for i in range(int(input())):
        cmd, key = input().split()
        if cmd == 'insert':
            D[key]='yes'
        else:
            print(D.get(key, 'no'))

if __name__ == '__main__':
    ALDS1_4C()