def f():
    return raw_input()
def f2():
    return raw_input().split()

dic = {}
n = int(f())
for i in range(n):
    c1, c2 = f2()
    if c1 == 'insert':
        dic[c2] = 548
    elif c1 == 'find':
        if dic.has_key(c2):
            print 'yes'
        else:
            print 'no' def f():
    return raw_input() f return raw_input() raw_input() raw_input def f2():
    return raw_input().split() f2 return raw_input().split() raw_input().split() ().split () raw_input split dic = {} dic {} n = int(f()) n int(f()) int f() f for i in range(n):
    c1, c2 = f2()
    if c1 == 'insert':
        dic[c2] = 548
    elif c1 == 'find':
        if dic.has_key(c2):
            print 'yes'
        else:
            print 'no' i range(n) range n c1, c2 = f2() c1 f2() f2 c2 if c1 == 'insert':
        dic[c2] = 548
    elif c1 == 'find':
        if dic.has_key(c2):
            print 'yes'
        else:
            print 'no' c1 == 'insert' c1 'insert' dic[c2] = 548 dic[c2] dic c2 548 elif c1 == 'find':
        if dic.has_key(c2):
            print 'yes'
        else:
            print 'no' c1 == 'find' c1 'find' if dic.has_key(c2):
            print 'yes'
        else:
            print 'no' dic.has_key(c2) dic.has_key dic has_key c2 print print c2 = f2() f2() c2 def f2():
    return raw_input().split() def f2():
    return raw_input().split() f2 c1, c2 = f2() f2() c1 def f():
    return raw_input() def f():
    return raw_input() f dic = {} {} dic n = int(f()) int(f()) n
def f():
    return raw_input()
def f2():
    return raw_input().split()

dic = {}
n = int(f())
for i in range(n):
    c1, c2 = f2()
    if c1 == 'insert':
        dic[c2] = 548
    elif c1 == 'find':
        if dic.has_key(c2):
            print 'yes'
        else:
            print 'no'