import sys

n = int(input())
dic = {}
input_ = [x.split() for x in sys.stdin.readlines()]

for c, s in input_:
    if c == 'insert':
        dic[s] = 0
    else:
        if s in dic:
            print('yes')
        else:
            print('no') import sys sys n = int(input()) n int(input()) int input() input dic = {} dic {} x.split() for x in sys.stdin.readlines() for x in sys.stdin.readlines() x sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines for x in sys.stdin.readlines() x.split() x.split x split input_ = [x.split() for x in sys.stdin.readlines()] input_ [x.split() for x in sys.stdin.readlines()] for c, s in input_:
    if c == 'insert':
        dic[s] = 0
    else:
        if s in dic:
            print('yes')
        else:
            print('no') c s input_ if c == 'insert':
        dic[s] = 0
    else:
        if s in dic:
            print('yes')
        else:
            print('no') c == 'insert' c 'insert' dic[s] = 0 dic[s] dic s 0 if s in dic:
            print('yes')
        else:
            print('no') s in dic s dic print('yes') print 'yes' print('no') print 'no' dic = {} {} dic input_ = [x.split() for x in sys.stdin.readlines()] [x.split() for x in sys.stdin.readlines()] input_ n = int(input()) int(input()) n
import sys

n = int(input())
dic = {}
input_ = [x.split() for x in sys.stdin.readlines()]

for c, s in input_:
    if c == 'insert':
        dic[s] = 0
    else:
        if s in dic:
            print('yes')
        else:
            print('no')