se = set([])
n = int(raw_input())
for i in range(n):
    order, string = raw_input().split()
    if order == 'insert':
        se.add(string)
    elif order == 'find':
        if string in se:
            print 'yes'
        else:
            print 'no' se = set([]) se set([]) set [] n = int(raw_input()) n int(raw_input()) int raw_input() raw_input for i in range(n):
    order, string = raw_input().split()
    if order == 'insert':
        se.add(string)
    elif order == 'find':
        if string in se:
            print 'yes'
        else:
            print 'no' i range(n) range n order, string = raw_input().split() order raw_input().split() ().split () raw_input split string if order == 'insert':
        se.add(string)
    elif order == 'find':
        if string in se:
            print 'yes'
        else:
            print 'no' order == 'insert' order 'insert' se.add(string) se.add se add string elif order == 'find':
        if string in se:
            print 'yes'
        else:
            print 'no' order == 'find' order 'find' if string in se:
            print 'yes'
        else:
            print 'no' string in se string se print print string = raw_input().split() raw_input().split() string se = set([]) set([]) se n = int(raw_input()) int(raw_input()) n order, string = raw_input().split() raw_input().split() order
se = set([])
n = int(raw_input())
for i in range(n):
    order, string = raw_input().split()
    if order == 'insert':
        se.add(string)
    elif order == 'find':
        if string in se:
            print 'yes'
        else:
            print 'no'