n = int(raw_input())
d = {}
for i in xrange(n):
    L = raw_input().split()
    if L[0] == 'insert':
        d[hash(L[1])] = L[1]
    else:
        if d.has_key(hash(L[1])):
            print 'yes'
        else:
            print 'no' n = int(raw_input()) n int(raw_input()) int raw_input() raw_input d = {} d {} for i in xrange(n):
    L = raw_input().split()
    if L[0] == 'insert':
        d[hash(L[1])] = L[1]
    else:
        if d.has_key(hash(L[1])):
            print 'yes'
        else:
            print 'no' i xrange(n) xrange n L = raw_input().split() L raw_input().split() ().split () raw_input split if L[0] == 'insert':
        d[hash(L[1])] = L[1]
    else:
        if d.has_key(hash(L[1])):
            print 'yes'
        else:
            print 'no' L[0] == 'insert' L[0] L 0 'insert' d[hash(L[1])] = L[1] d[hash(L[1])] d hash(L[1]) hash L[1] L 1 L[1] L 1 if d.has_key(hash(L[1])):
            print 'yes'
        else:
            print 'no' d.has_key(hash(L[1])) d.has_key d has_key hash(L[1]) hash L[1] L 1 print print n = int(raw_input()) int(raw_input()) n L = raw_input().split() raw_input().split() L d = {} {} d
n = int(raw_input())
d = {}
for i in xrange(n):
    L = raw_input().split()
    if L[0] == 'insert':
        d[hash(L[1])] = L[1]
    else:
        if d.has_key(hash(L[1])):
            print 'yes'
        else:
            print 'no'