n = input()
dic = set([])
for i in xrange(n):
    order = raw_input().split()
    if order[0][0] == 'i':
        dic.add(order[1])
    else:
        print "yes" if order[1] in dic else "no" n = input() n input() input dic = set([]) dic set([]) set [] for i in xrange(n):
    order = raw_input().split()
    if order[0][0] == 'i':
        dic.add(order[1])
    else:
        print "yes" if order[1] in dic else "no" i xrange(n) xrange n order = raw_input().split() order raw_input().split() ().split () raw_input split if order[0][0] == 'i':
        dic.add(order[1])
    else:
        print "yes" if order[1] in dic else "no" order[0][0] == 'i' order[0][0] [0] order 0 0 'i' dic.add(order[1]) dic.add dic add order[1] order 1 print "yes" if order[1] in dic else "no" order[1] in dic order[1] order 1 dic "yes" "no" order = raw_input().split() raw_input().split() order dic = set([]) set([]) dic n = input() input() n
n = input()
dic = set([])
for i in xrange(n):
    order = raw_input().split()
    if order[0][0] == 'i':
        dic.add(order[1])
    else:
        print "yes" if order[1] in dic else "no"