import sys

num = int(input())
dic = set()

for i in range(num):
    order = sys.stdin.readline().split()

    if order[0] == 'insert':
        dic.add(order[1])
    else:
        if order[1] in dic:
            print('yes')
        else:
            print('no') import sys sys num = int(input()) num int(input()) int input() input dic = set() dic set() set for i in range(num):
    order = sys.stdin.readline().split()

    if order[0] == 'insert':
        dic.add(order[1])
    else:
        if order[1] in dic:
            print('yes')
        else:
            print('no') i range(num) range num order = sys.stdin.readline().split() order sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split if order[0] == 'insert':
        dic.add(order[1])
    else:
        if order[1] in dic:
            print('yes')
        else:
            print('no') order[0] == 'insert' order[0] order 0 'insert' dic.add(order[1]) dic.add dic add order[1] order 1 if order[1] in dic:
            print('yes')
        else:
            print('no') order[1] in dic order[1] order 1 dic print('yes') print 'yes' print('no') print 'no' order = sys.stdin.readline().split() sys.stdin.readline().split() order num = int(input()) int(input()) num dic = set() set() dic
import sys

num = int(input())
dic = set()

for i in range(num):
    order = sys.stdin.readline().split()

    if order[0] == 'insert':
        dic.add(order[1])
    else:
        if order[1] in dic:
            print('yes')
        else:
            print('no')