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

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

    counter += 1 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[0] == 'i':
        dictionary[key] = None
    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[0] == 'i':
        dictionary[key] = None
    else:
        if key in dictionary:
            print 'yes'
        else:
            print 'no'

     command[0] == 'i' command[0] command 0 'i' dictionary[key] = None dictionary[key] dictionary key None if key in dictionary:
            print 'yes'
        else:
            print 'no'

     key in dictionary key dictionary print print counter += 1 counter 1 key = raw_input().split(' ') raw_input().split(' ') key counter += 1 1 counter dictionary = {} {} dictionary command, key = raw_input().split(' ') raw_input().split(' ') command counter = 0 0 counter input_num = int(raw_input()) int(raw_input()) input_num
# -*- coding: utf-8 -*-

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

    counter += 1