# coding=utf-8

n = int(input())
dic = set()

for i in range(n):
    cmd = input().split()
    if cmd[0] == 'insert':
        dic.add(cmd[1])
    else:
        if cmd[1] in dic:
            print('yes')
        else:
            print('no') n = int(input()) n int(input()) int input() input dic = set() dic set() set for i in range(n):
    cmd = input().split()
    if cmd[0] == 'insert':
        dic.add(cmd[1])
    else:
        if cmd[1] in dic:
            print('yes')
        else:
            print('no') i range(n) range n cmd = input().split() cmd input().split() ().split () input split if cmd[0] == 'insert':
        dic.add(cmd[1])
    else:
        if cmd[1] in dic:
            print('yes')
        else:
            print('no') cmd[0] == 'insert' cmd[0] cmd 0 'insert' dic.add(cmd[1]) dic.add dic add cmd[1] cmd 1 if cmd[1] in dic:
            print('yes')
        else:
            print('no') cmd[1] in dic cmd[1] cmd 1 dic print('yes') print 'yes' print('no') print 'no' dic = set() set() dic cmd = input().split() input().split() cmd n = int(input()) int(input()) n
# coding=utf-8

n = int(input())
dic = set()

for i in range(n):
    cmd = input().split()
    if cmd[0] == 'insert':
        dic.add(cmd[1])
    else:
        if cmd[1] in dic:
            print('yes')
        else:
            print('no')