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

for i in range(n):
    o = input().split()
    if o[0] == 'insert':
        dic.add(o[1])
    elif o[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):
    o = input().split()
    if o[0] == 'insert':
        dic.add(o[1])
    elif o[1] in dic:
        print('yes')
    else:
        print('no') i range(n) range n o = input().split() o input().split() ().split () input split if o[0] == 'insert':
        dic.add(o[1])
    elif o[1] in dic:
        print('yes')
    else:
        print('no') o[0] == 'insert' o[0] o 0 'insert' dic.add(o[1]) dic.add dic add o[1] o 1 elif o[1] in dic:
        print('yes')
     o[1] in dic o[1] o 1 dic print('yes') print 'yes' print('no') print 'no' n = int(input()) int(input()) n o = input().split() input().split() o dic = set() set() dic
n = int(input())
dic = set()

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