#!/usr/bin/env python
# -*- coding: utf-8 -*-


import sys


def h1(key):
    return key % m


def h2(key):
    return 1 + (key % (m - 1))


def h(key, i):
    return (h1(key) + i * h2(key)) % m


def insert(T, key):
    i = 0
    while True:
        j = h(key, i)
        if T[j] == 'NULL':
            T[j] = key
            return j
        else:
            i += 1


def search(T, key):
    i = 0
    while True:
        j = h(key, i)
        if T[j] == key:
            print('yes')
            return j
        elif T[j] == 'NULL' or i >= m:
            print('no')
            return 'NULL'
        else:
            i += 1


def str_to_key(_str):
    _length = len(_str)
    _sum, p = 0, 1
    for i in range(_length):
        _sum += p * (ord(_str[i]) - 64)
        # why choose p=5 ?
        p *= 5

    # key = sum([ord(each) - 64
    #            for each in _str])
    # print(key, _str)
    return _sum


def action(command, content):
    key = str_to_key(content)
    if command[0] == 'i':
        insert(T=T, key=key)
    elif command[0] == 'f':
        search(T=T, key=key)
    return None


if __name__ == '__main__':
    _input = sys.stdin.readlines()
    m = 1046527
    length = int(_input[0])
    command_list = list(map(lambda x: x.split(), _input[1:]))
    T = ['NULL' for _ in range(m)]
    for command, content in command_list:
        action(command=command, content=content) import sys sys def h1(key):
    return key % m h1 return key % m key % m key m key key def h2(key):
    return 1 + (key % (m - 1)) h2 return 1 + (key % (m - 1)) 1 + (key % (m - 1)) 1 key % (m - 1) key m - 1 m 1 key key def h(key, i):
    return (h1(key) + i * h2(key)) % m h return (h1(key) + i * h2(key)) % m (h1(key) + i * h2(key)) % m h1(key) + i * h2(key) h1(key) h1 key i * h2(key) i h2(key) h2 key m key key i i def insert(T, key):
    i = 0
    while True:
        j = h(key, i)
        if T[j] == 'NULL':
            T[j] = key
            return j
        else:
            i += 1 insert i = 0 i 0 while True:
        j = h(key, i)
        if T[j] == 'NULL':
            T[j] = key
            return j
        else:
            i += 1 True j = h(key, i) j h(key, i) h key i if T[j] == 'NULL':
            T[j] = key
            return j
        else:
            i += 1 T[j] == 'NULL' T[j] T j 'NULL' T[j] = key T[j] T j key return j j i += 1 i 1 T T key key def search(T, key):
    i = 0
    while True:
        j = h(key, i)
        if T[j] == key:
            print('yes')
            return j
        elif T[j] == 'NULL' or i >= m:
            print('no')
            return 'NULL'
        else:
            i += 1 search i = 0 i 0 while True:
        j = h(key, i)
        if T[j] == key:
            print('yes')
            return j
        elif T[j] == 'NULL' or i >= m:
            print('no')
            return 'NULL'
        else:
            i += 1 True j = h(key, i) j h(key, i) h key i if T[j] == key:
            print('yes')
            return j
        elif T[j] == 'NULL' or i >= m:
            print('no')
            return 'NULL'
        else:
            i += 1 T[j] == key T[j] T j key print('yes') print 'yes' return j j elif T[j] == 'NULL' or i >= m:
            print('no')
            return 'NULL'
         T[j] == 'NULL' or i >= m T[j] == 'NULL' T[j] T j 'NULL' i >= m i m print('no') print 'no' return 'NULL' 'NULL' i += 1 i 1 T T key key def str_to_key(_str):
    _length = len(_str)
    _sum, p = 0, 1
    for i in range(_length):
        _sum += p * (ord(_str[i]) - 64)
        # why choose p=5 ?
        p *= 5

    # key = sum([ord(each) - 64
    #            for each in _str])
    # print(key, _str)
    return _sum str_to_key _length = len(_str) _length len(_str) len _str _sum, p = 0, 1 _sum 0 p 1 for i in range(_length):
        _sum += p * (ord(_str[i]) - 64)
        # why choose p=5 ?
        p *= 5

    # key = sum([ord(each) - 64
    #            for each in _str])
    # print(key, _str)
     i range(_length) range _length _sum += p * (ord(_str[i]) - 64) _sum p * (ord(_str[i]) - 64) p ord(_str[i]) - 64 ord(_str[i]) ord _str[i] _str i 64 p *= 5 p 5 return _sum _sum _str _str def action(command, content):
    key = str_to_key(content)
    if command[0] == 'i':
        insert(T=T, key=key)
    elif command[0] == 'f':
        search(T=T, key=key)
    return None action key = str_to_key(content) key str_to_key(content) str_to_key content if command[0] == 'i':
        insert(T=T, key=key)
    elif command[0] == 'f':
        search(T=T, key=key)
     command[0] == 'i' command[0] command 0 'i' insert(T=T, key=key) insert T=T T T key=key key key elif command[0] == 'f':
        search(T=T, key=key)
     command[0] == 'f' command[0] command 0 'f' search(T=T, key=key) search T=T T T key=key key key return None None command command content content if __name__ == '__main__':
    _input = sys.stdin.readlines()
    m = 1046527
    length = int(_input[0])
    command_list = list(map(lambda x: x.split(), _input[1:]))
    T = ['NULL' for _ in range(m)]
    for command, content in command_list:
        action(command=command, content=content) __name__ == '__main__' __name__ '__main__' _input = sys.stdin.readlines() _input sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines m = 1046527 m 1046527 length = int(_input[0]) length int(_input[0]) int _input[0] _input 0 command_list = list(map(lambda x: x.split(), _input[1:])) command_list list(map(lambda x: x.split(), _input[1:])) list map(lambda x: x.split(), _input[1:]) map lambda x: x.split() x.split() x.split x split x _input[1:] _input 1: 1 'NULL' for _ in range(m) for _ in range(m) _ range(m) range m for _ in range(m) 'NULL' T = ['NULL' for _ in range(m)] T ['NULL' for _ in range(m)] for command, content in command_list:
        action(command=command, content=content) command content command_list action(command=command, content=content) action command=command command command content=content content content m = 1046527 1046527 m def str_to_key(_str):
    _length = len(_str)
    _sum, p = 0, 1
    for i in range(_length):
        _sum += p * (ord(_str[i]) - 64)
        # why choose p=5 ?
        p *= 5

    # key = sum([ord(each) - 64
    #            for each in _str])
    # print(key, _str)
    return _sum def str_to_key(_str):
    _length = len(_str)
    _sum, p = 0, 1
    for i in range(_length):
        _sum += p * (ord(_str[i]) - 64)
        # why choose p=5 ?
        p *= 5

    # key = sum([ord(each) - 64
    #            for each in _str])
    # print(key, _str)
    return _sum str_to_key def h2(key):
    return 1 + (key % (m - 1)) def h2(key):
    return 1 + (key % (m - 1)) h2 length = int(_input[0]) int(_input[0]) length def search(T, key):
    i = 0
    while True:
        j = h(key, i)
        if T[j] == key:
            print('yes')
            return j
        elif T[j] == 'NULL' or i >= m:
            print('no')
            return 'NULL'
        else:
            i += 1 def search(T, key):
    i = 0
    while True:
        j = h(key, i)
        if T[j] == key:
            print('yes')
            return j
        elif T[j] == 'NULL' or i >= m:
            print('no')
            return 'NULL'
        else:
            i += 1 search def insert(T, key):
    i = 0
    while True:
        j = h(key, i)
        if T[j] == 'NULL':
            T[j] = key
            return j
        else:
            i += 1 def insert(T, key):
    i = 0
    while True:
        j = h(key, i)
        if T[j] == 'NULL':
            T[j] = key
            return j
        else:
            i += 1 insert _input = sys.stdin.readlines() sys.stdin.readlines() _input def h(key, i):
    return (h1(key) + i * h2(key)) % m def h(key, i):
    return (h1(key) + i * h2(key)) % m h command_list = list(map(lambda x: x.split(), _input[1:])) list(map(lambda x: x.split(), _input[1:])) command_list def h1(key):
    return key % m def h1(key):
    return key % m h1 def action(command, content):
    key = str_to_key(content)
    if command[0] == 'i':
        insert(T=T, key=key)
    elif command[0] == 'f':
        search(T=T, key=key)
    return None def action(command, content):
    key = str_to_key(content)
    if command[0] == 'i':
        insert(T=T, key=key)
    elif command[0] == 'f':
        search(T=T, key=key)
    return None action T = ['NULL' for _ in range(m)] ['NULL' for _ in range(m)] T
#!/usr/bin/env python
# -*- coding: utf-8 -*-


import sys


def h1(key):
    return key % m


def h2(key):
    return 1 + (key % (m - 1))


def h(key, i):
    return (h1(key) + i * h2(key)) % m


def insert(T, key):
    i = 0
    while True:
        j = h(key, i)
        if T[j] == 'NULL':
            T[j] = key
            return j
        else:
            i += 1


def search(T, key):
    i = 0
    while True:
        j = h(key, i)
        if T[j] == key:
            print('yes')
            return j
        elif T[j] == 'NULL' or i >= m:
            print('no')
            return 'NULL'
        else:
            i += 1


def str_to_key(_str):
    _length = len(_str)
    _sum, p = 0, 1
    for i in range(_length):
        _sum += p * (ord(_str[i]) - 64)
        # why choose p=5 ?
        p *= 5

    # key = sum([ord(each) - 64
    #            for each in _str])
    # print(key, _str)
    return _sum


def action(command, content):
    key = str_to_key(content)
    if command[0] == 'i':
        insert(T=T, key=key)
    elif command[0] == 'f':
        search(T=T, key=key)
    return None


if __name__ == '__main__':
    _input = sys.stdin.readlines()
    m = 1046527
    length = int(_input[0])
    command_list = list(map(lambda x: x.split(), _input[1:]))
    T = ['NULL' for _ in range(m)]
    for command, content in command_list:
        action(command=command, content=content)