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