from collections import defaultdict
n = int(input())
dic = defaultdict(lambda: 0)
for _ in range(n):
    com = input().split(' ')
    if com[0]=='insert':
        dic[com[1]] = 1
    else:
        if com[1] in dic:
            print('yes')
        else:
            print('no') from collections import defaultdict n = int(input()) n int(input()) int input() input dic = defaultdict(lambda: 0) dic defaultdict(lambda: 0) defaultdict lambda: 0 0 for _ in range(n):
    com = input().split(' ')
    if com[0]=='insert':
        dic[com[1]] = 1
    else:
        if com[1] in dic:
            print('yes')
        else:
            print('no') _ range(n) range n com = input().split(' ') com input().split(' ') ().split () input split ' ' if com[0]=='insert':
        dic[com[1]] = 1
    else:
        if com[1] in dic:
            print('yes')
        else:
            print('no') com[0]=='insert' com[0] com 0 'insert' dic[com[1]] = 1 dic[com[1]] dic com[1] com 1 1 if com[1] in dic:
            print('yes')
        else:
            print('no') com[1] in dic com[1] com 1 dic print('yes') print 'yes' print('no') print 'no' dic = defaultdict(lambda: 0) defaultdict(lambda: 0) dic com = input().split(' ') input().split(' ') com n = int(input()) int(input()) n
from collections import defaultdict
n = int(input())
dic = defaultdict(lambda: 0)
for _ in range(n):
    com = input().split(' ')
    if com[0]=='insert':
        dic[com[1]] = 1
    else:
        if com[1] in dic:
            print('yes')
        else:
            print('no')