class HashTable:
    def __init__(self, size = 1000003):
        self.size = size
        self.hash_table = [None] * size

    def _gen_key(self, val):
        raw_hash_val = hash(val)
        h1 = raw_hash_val % self.size
        h2 = 1 + (raw_hash_val % (self.size - 1))
        for i in range(self.size):
            candidate_key = (h1 + i * h2) % self.size
            if not self.hash_table[candidate_key] or self.hash_table[candidate_key] == val:
                return candidate_key

    def insert(self, val):
        key = self._gen_key(val)
        self.hash_table[key] = val

    def search(self, val):
        key = self._gen_key(val)
        if self.hash_table[key]:
            print('yes')
        else:
            print('no')


import sys

n = int(sys.stdin.readline())

simple_dict = HashTable()

ans = ''

for i in range(n):
    operation = sys.stdin.readline()
    if operation[0] == 'i':
        simple_dict.insert(operation[7:])
    else:
        simple_dict.search(operation[5:]) class HashTable:
    def __init__(self, size = 1000003):
        self.size = size
        self.hash_table = [None] * size

    def _gen_key(self, val):
        raw_hash_val = hash(val)
        h1 = raw_hash_val % self.size
        h2 = 1 + (raw_hash_val % (self.size - 1))
        for i in range(self.size):
            candidate_key = (h1 + i * h2) % self.size
            if not self.hash_table[candidate_key] or self.hash_table[candidate_key] == val:
                return candidate_key

    def insert(self, val):
        key = self._gen_key(val)
        self.hash_table[key] = val

    def search(self, val):
        key = self._gen_key(val)
        if self.hash_table[key]:
            print('yes')
        else:
            print('no') HashTable def __init__(self, size = 1000003):
        self.size = size
        self.hash_table = [None] * size

     __init__ self.size = size self.size self size size self.hash_table = [None] * size self.hash_table self hash_table [None] * size [None] None size self self size = 1000003 size 1000003 def _gen_key(self, val):
        raw_hash_val = hash(val)
        h1 = raw_hash_val % self.size
        h2 = 1 + (raw_hash_val % (self.size - 1))
        for i in range(self.size):
            candidate_key = (h1 + i * h2) % self.size
            if not self.hash_table[candidate_key] or self.hash_table[candidate_key] == val:
                return candidate_key

     _gen_key raw_hash_val = hash(val) raw_hash_val hash(val) hash val h1 = raw_hash_val % self.size h1 raw_hash_val % self.size raw_hash_val self.size self size h2 = 1 + (raw_hash_val % (self.size - 1)) h2 1 + (raw_hash_val % (self.size - 1)) 1 raw_hash_val % (self.size - 1) raw_hash_val self.size - 1 self.size self size 1 for i in range(self.size):
            candidate_key = (h1 + i * h2) % self.size
            if not self.hash_table[candidate_key] or self.hash_table[candidate_key] == val:
                return candidate_key

     i range(self.size) range self.size self size candidate_key = (h1 + i * h2) % self.size candidate_key (h1 + i * h2) % self.size h1 + i * h2 h1 i * h2 i h2 self.size self size if not self.hash_table[candidate_key] or self.hash_table[candidate_key] == val:
                return candidate_key

     not self.hash_table[candidate_key] or self.hash_table[candidate_key] == val not self.hash_table[candidate_key] self.hash_table[candidate_key] self.hash_table self hash_table candidate_key self.hash_table[candidate_key] == val self.hash_table[candidate_key] self.hash_table self hash_table candidate_key val return candidate_key candidate_key self self val val def insert(self, val):
        key = self._gen_key(val)
        self.hash_table[key] = val

     insert key = self._gen_key(val) key self._gen_key(val) self._gen_key self _gen_key val self.hash_table[key] = val self.hash_table[key] self.hash_table self hash_table key val self self val val def search(self, val):
        key = self._gen_key(val)
        if self.hash_table[key]:
            print('yes')
        else:
            print('no') search key = self._gen_key(val) key self._gen_key(val) self._gen_key self _gen_key val if self.hash_table[key]:
            print('yes')
        else:
            print('no') self.hash_table[key] self.hash_table self hash_table key print('yes') print 'yes' print('no') print 'no' self self val val import sys sys n = int(sys.stdin.readline()) n int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline simple_dict = HashTable() simple_dict HashTable() HashTable ans = '' ans '' for i in range(n):
    operation = sys.stdin.readline()
    if operation[0] == 'i':
        simple_dict.insert(operation[7:])
    else:
        simple_dict.search(operation[5:]) i range(n) range n operation = sys.stdin.readline() operation sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline if operation[0] == 'i':
        simple_dict.insert(operation[7:])
    else:
        simple_dict.search(operation[5:]) operation[0] == 'i' operation[0] operation 0 'i' simple_dict.insert(operation[7:]) simple_dict.insert simple_dict insert operation[7:] operation 7: 7 simple_dict.search(operation[5:]) simple_dict.search simple_dict search operation[5:] operation 5: 5 operation = sys.stdin.readline() sys.stdin.readline() operation class HashTable:
    def __init__(self, size = 1000003):
        self.size = size
        self.hash_table = [None] * size

    def _gen_key(self, val):
        raw_hash_val = hash(val)
        h1 = raw_hash_val % self.size
        h2 = 1 + (raw_hash_val % (self.size - 1))
        for i in range(self.size):
            candidate_key = (h1 + i * h2) % self.size
            if not self.hash_table[candidate_key] or self.hash_table[candidate_key] == val:
                return candidate_key

    def insert(self, val):
        key = self._gen_key(val)
        self.hash_table[key] = val

    def search(self, val):
        key = self._gen_key(val)
        if self.hash_table[key]:
            print('yes')
        else:
            print('no') class HashTable:
    def __init__(self, size = 1000003):
        self.size = size
        self.hash_table = [None] * size

    def _gen_key(self, val):
        raw_hash_val = hash(val)
        h1 = raw_hash_val % self.size
        h2 = 1 + (raw_hash_val % (self.size - 1))
        for i in range(self.size):
            candidate_key = (h1 + i * h2) % self.size
            if not self.hash_table[candidate_key] or self.hash_table[candidate_key] == val:
                return candidate_key

    def insert(self, val):
        key = self._gen_key(val)
        self.hash_table[key] = val

    def search(self, val):
        key = self._gen_key(val)
        if self.hash_table[key]:
            print('yes')
        else:
            print('no') HashTable simple_dict = HashTable() HashTable() simple_dict ans = '' '' ans n = int(sys.stdin.readline()) int(sys.stdin.readline()) n
class HashTable:
    def __init__(self, size = 1000003):
        self.size = size
        self.hash_table = [None] * size

    def _gen_key(self, val):
        raw_hash_val = hash(val)
        h1 = raw_hash_val % self.size
        h2 = 1 + (raw_hash_val % (self.size - 1))
        for i in range(self.size):
            candidate_key = (h1 + i * h2) % self.size
            if not self.hash_table[candidate_key] or self.hash_table[candidate_key] == val:
                return candidate_key

    def insert(self, val):
        key = self._gen_key(val)
        self.hash_table[key] = val

    def search(self, val):
        key = self._gen_key(val)
        if self.hash_table[key]:
            print('yes')
        else:
            print('no')


import sys

n = int(sys.stdin.readline())

simple_dict = HashTable()

ans = ''

for i in range(n):
    operation = sys.stdin.readline()
    if operation[0] == 'i':
        simple_dict.insert(operation[7:])
    else:
        simple_dict.search(operation[5:])