# -*- coding: utf-8 -*-

def main():
    dictionary = {}
    input_num = int(raw_input())
    counter = 0
    while counter < input_num:
        command, key = raw_input().split(' ')
        if command == 'insert':
            dictionary[key] = True
        else:
            if key in dictionary:
                print 'yes'
            else:
              print 'no'

        counter += 1


if __name__ == '__main__':
    main() def main():
    dictionary = {}
    input_num = int(raw_input())
    counter = 0
    while counter < input_num:
        command, key = raw_input().split(' ')
        if command == 'insert':
            dictionary[key] = True
        else:
            if key in dictionary:
                print 'yes'
            else:
              print 'no'

        counter += 1 main dictionary = {} dictionary {} input_num = int(raw_input()) input_num int(raw_input()) int raw_input() raw_input counter = 0 counter 0 while counter < input_num:
        command, key = raw_input().split(' ')
        if command == 'insert':
            dictionary[key] = True
        else:
            if key in dictionary:
                print 'yes'
            else:
              print 'no'

        counter += 1 counter < input_num counter input_num command, key = raw_input().split(' ') command raw_input().split(' ') ().split () raw_input split ' ' key if command == 'insert':
            dictionary[key] = True
        else:
            if key in dictionary:
                print 'yes'
            else:
              print 'no'

         command == 'insert' command 'insert' dictionary[key] = True dictionary[key] dictionary key True if key in dictionary:
                print 'yes'
            else:
              print 'no'

         key in dictionary key dictionary print print counter += 1 counter 1 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    dictionary = {}
    input_num = int(raw_input())
    counter = 0
    while counter < input_num:
        command, key = raw_input().split(' ')
        if command == 'insert':
            dictionary[key] = True
        else:
            if key in dictionary:
                print 'yes'
            else:
              print 'no'

        counter += 1 def main():
    dictionary = {}
    input_num = int(raw_input())
    counter = 0
    while counter < input_num:
        command, key = raw_input().split(' ')
        if command == 'insert':
            dictionary[key] = True
        else:
            if key in dictionary:
                print 'yes'
            else:
              print 'no'

        counter += 1 main
# -*- coding: utf-8 -*-

def main():
    dictionary = {}
    input_num = int(raw_input())
    counter = 0
    while counter < input_num:
        command, key = raw_input().split(' ')
        if command == 'insert':
            dictionary[key] = True
        else:
            if key in dictionary:
                print 'yes'
            else:
              print 'no'

        counter += 1


if __name__ == '__main__':
    main()