def use_dictionary(commands):
    d = {}
    for cmd, word in commands:
        if cmd == 'insert':
            d[word] = True
        elif cmd == 'find':
            if word in d:
                print('yes')
            else:
                print('no')

if __name__ == '__main__':
    # ??????????????\???
    commands = []
    # commands.append(('insert', 'AAA'))
    # commands.append(('insert', 'AAC'))
    # commands.append(('find', 'AAA'))
    # commands.append(('find', 'CCC'))
    # commands.append(('insert', 'CCC'))
    # commands.append(('find', 'CCC'))
    num = int(input())
    for i in range(num):
        commands.append([x for x in input().split(' ')])

    # ???????????????
    use_dictionary(commands)

    # ???????????¨??? def use_dictionary(commands):
    d = {}
    for cmd, word in commands:
        if cmd == 'insert':
            d[word] = True
        elif cmd == 'find':
            if word in d:
                print('yes')
            else:
                print('no') use_dictionary d = {} d {} for cmd, word in commands:
        if cmd == 'insert':
            d[word] = True
        elif cmd == 'find':
            if word in d:
                print('yes')
            else:
                print('no') cmd word commands if cmd == 'insert':
            d[word] = True
        elif cmd == 'find':
            if word in d:
                print('yes')
            else:
                print('no') cmd == 'insert' cmd 'insert' d[word] = True d[word] d word True elif cmd == 'find':
            if word in d:
                print('yes')
            else:
                print('no') cmd == 'find' cmd 'find' if word in d:
                print('yes')
            else:
                print('no') word in d word d print('yes') print 'yes' print('no') print 'no' commands commands if __name__ == '__main__':
    # ??????????????\???
    commands = []
    # commands.append(('insert', 'AAA'))
    # commands.append(('insert', 'AAC'))
    # commands.append(('find', 'AAA'))
    # commands.append(('find', 'CCC'))
    # commands.append(('insert', 'CCC'))
    # commands.append(('find', 'CCC'))
    num = int(input())
    for i in range(num):
        commands.append([x for x in input().split(' ')])

    # ???????????????
    use_dictionary(commands)

    # ???????????¨??? __name__ == '__main__' __name__ '__main__' commands = [] commands [] num = int(input()) num int(input()) int input() input for i in range(num):
        commands.append([x for x in input().split(' ')])

    # ???????????????
     i range(num) range num x for x in input().split(' ') for x in input().split(' ') x input().split(' ') ().split () input split ' ' for x in input().split(' ') x commands.append([x for x in input().split(' ')]) commands.append commands append [x for x in input().split(' ')] use_dictionary(commands) use_dictionary commands def use_dictionary(commands):
    d = {}
    for cmd, word in commands:
        if cmd == 'insert':
            d[word] = True
        elif cmd == 'find':
            if word in d:
                print('yes')
            else:
                print('no') def use_dictionary(commands):
    d = {}
    for cmd, word in commands:
        if cmd == 'insert':
            d[word] = True
        elif cmd == 'find':
            if word in d:
                print('yes')
            else:
                print('no') use_dictionary commands = [] [] commands num = int(input()) int(input()) num
def use_dictionary(commands):
    d = {}
    for cmd, word in commands:
        if cmd == 'insert':
            d[word] = True
        elif cmd == 'find':
            if word in d:
                print('yes')
            else:
                print('no')

if __name__ == '__main__':
    # ??????????????\???
    commands = []
    # commands.append(('insert', 'AAA'))
    # commands.append(('insert', 'AAC'))
    # commands.append(('find', 'AAA'))
    # commands.append(('find', 'CCC'))
    # commands.append(('insert', 'CCC'))
    # commands.append(('find', 'CCC'))
    num = int(input())
    for i in range(num):
        commands.append([x for x in input().split(' ')])

    # ???????????????
    use_dictionary(commands)

    # ???????????¨???