class HashTable:

    @staticmethod
    def h1(key):
        return key % 1046527

    @staticmethod
    def h2(key):
        return 1 + (key % (1046527 - 1))
    
    def __init__(self, size):
        self.size = size
        self.values = [None for _ in range(size)]
        self.tables = str.maketrans({
            'A':'1', 'C':'2', 'G':'3', 'T':'4',
        })

    def translate_key(self, value):
        return int(value.translate(self.tables))

    def find(self, value):
        count = 0
        key = self.translate_key(value)

        while True:
            h = (HashTable.h1(key) + count * HashTable.h2(key)) % 1046527
            if self.values[h] == value:
                return True
            elif self.values[h] is None:
                return False
            count += 1
        return False

    def insert(self, value):
        count = 0
        key = self.translate_key(value)
        
        while True:
            h = (HashTable.h1(key) + count * HashTable.h2(key)) % 1046527
            if self.values[h] is None:
                self.values[h] = value
                break
            count += 1


num = int(input())

dictionary = HashTable(1046527)
for _ in range(num):
    command, value = input().split()
    if command == "insert":
        dictionary.insert(value)
    elif command == "find":
        is_find = dictionary.find(value)
        print("yes" if is_find else "no") class HashTable:

    @staticmethod
    def h1(key):
        return key % 1046527

    @staticmethod
    def h2(key):
        return 1 + (key % (1046527 - 1))
    
    def __init__(self, size):
        self.size = size
        self.values = [None for _ in range(size)]
        self.tables = str.maketrans({
            'A':'1', 'C':'2', 'G':'3', 'T':'4',
        })

    def translate_key(self, value):
        return int(value.translate(self.tables))

    def find(self, value):
        count = 0
        key = self.translate_key(value)

        while True:
            h = (HashTable.h1(key) + count * HashTable.h2(key)) % 1046527
            if self.values[h] == value:
                return True
            elif self.values[h] is None:
                return False
            count += 1
        return False

    def insert(self, value):
        count = 0
        key = self.translate_key(value)
        
        while True:
            h = (HashTable.h1(key) + count * HashTable.h2(key)) % 1046527
            if self.values[h] is None:
                self.values[h] = value
                break
            count += 1 HashTable def h1(key):
        return key % 1046527

     h1 return key % 1046527 key % 1046527 key 1046527 key key @staticmethod
     h1 staticmethod h1 def h2(key):
        return 1 + (key % (1046527 - 1))
    
     h2 return 1 + (key % (1046527 - 1)) 1 + (key % (1046527 - 1)) 1 key % (1046527 - 1) key 1046527 - 1 1046527 1 key key @staticmethod
     h2 staticmethod h2 def __init__(self, size):
        self.size = size
        self.values = [None for _ in range(size)]
        self.tables = str.maketrans({
            'A':'1', 'C':'2', 'G':'3', 'T':'4',
        })

     __init__ self.size = size self.size self size size None for _ in range(size) for _ in range(size) _ range(size) range size for _ in range(size) None self.values = [None for _ in range(size)] self.values self values [None for _ in range(size)] self.tables = str.maketrans({
            'A':'1', 'C':'2', 'G':'3', 'T':'4',
        }) self.tables self tables str.maketrans({
            'A':'1', 'C':'2', 'G':'3', 'T':'4',
        }) str.maketrans str maketrans {
            'A':'1', 'C':'2', 'G':'3', 'T':'4',
        } 'A' 'A' '1' 'C' 'C' '2' 'G' 'G' '3' 'T' 'T' '4' self self size size def translate_key(self, value):
        return int(value.translate(self.tables))

     translate_key return int(value.translate(self.tables)) int(value.translate(self.tables)) int value.translate(self.tables) value.translate value translate self.tables self tables self self value value def find(self, value):
        count = 0
        key = self.translate_key(value)

        while True:
            h = (HashTable.h1(key) + count * HashTable.h2(key)) % 1046527
            if self.values[h] == value:
                return True
            elif self.values[h] is None:
                return False
            count += 1
        return False

     find count = 0 count 0 key = self.translate_key(value) key self.translate_key(value) self.translate_key self translate_key value while True:
            h = (HashTable.h1(key) + count * HashTable.h2(key)) % 1046527
            if self.values[h] == value:
                return True
            elif self.values[h] is None:
                return False
            count += 1
         True h = (HashTable.h1(key) + count * HashTable.h2(key)) % 1046527 h (HashTable.h1(key) + count * HashTable.h2(key)) % 1046527 HashTable.h1(key) + count * HashTable.h2(key) HashTable.h1(key) HashTable.h1 HashTable h1 key count * HashTable.h2(key) count HashTable.h2(key) HashTable.h2 HashTable h2 key 1046527 if self.values[h] == value:
                return True
            elif self.values[h] is None:
                return False
             self.values[h] == value self.values[h] self.values self values h value return True True elif self.values[h] is None:
                return False
             self.values[h] is None self.values[h] self.values self values h None return False False count += 1 count 1 return False False self self value value def insert(self, value):
        count = 0
        key = self.translate_key(value)
        
        while True:
            h = (HashTable.h1(key) + count * HashTable.h2(key)) % 1046527
            if self.values[h] is None:
                self.values[h] = value
                break
            count += 1 insert count = 0 count 0 key = self.translate_key(value) key self.translate_key(value) self.translate_key self translate_key value while True:
            h = (HashTable.h1(key) + count * HashTable.h2(key)) % 1046527
            if self.values[h] is None:
                self.values[h] = value
                break
            count += 1 True h = (HashTable.h1(key) + count * HashTable.h2(key)) % 1046527 h (HashTable.h1(key) + count * HashTable.h2(key)) % 1046527 HashTable.h1(key) + count * HashTable.h2(key) HashTable.h1(key) HashTable.h1 HashTable h1 key count * HashTable.h2(key) count HashTable.h2(key) HashTable.h2 HashTable h2 key 1046527 if self.values[h] is None:
                self.values[h] = value
                break
             self.values[h] is None self.values[h] self.values self values h None self.values[h] = value self.values[h] self.values self values h value break count += 1 count 1 self self value value num = int(input()) num int(input()) int input() input dictionary = HashTable(1046527) dictionary HashTable(1046527) HashTable 1046527 for _ in range(num):
    command, value = input().split()
    if command == "insert":
        dictionary.insert(value)
    elif command == "find":
        is_find = dictionary.find(value)
        print("yes" if is_find else "no") _ range(num) range num command, value = input().split() command input().split() ().split () input split value if command == "insert":
        dictionary.insert(value)
    elif command == "find":
        is_find = dictionary.find(value)
        print("yes" if is_find else "no") command == "insert" command "insert" dictionary.insert(value) dictionary.insert dictionary insert value elif command == "find":
        is_find = dictionary.find(value)
        print("yes" if is_find else "no") command == "find" command "find" is_find = dictionary.find(value) is_find dictionary.find(value) dictionary.find dictionary find value print("yes" if is_find else "no") print "yes" if is_find else "no" is_find "yes" "no" dictionary = HashTable(1046527) HashTable(1046527) dictionary num = int(input()) int(input()) num value = input().split() input().split() value class HashTable:

    @staticmethod
    def h1(key):
        return key % 1046527

    @staticmethod
    def h2(key):
        return 1 + (key % (1046527 - 1))
    
    def __init__(self, size):
        self.size = size
        self.values = [None for _ in range(size)]
        self.tables = str.maketrans({
            'A':'1', 'C':'2', 'G':'3', 'T':'4',
        })

    def translate_key(self, value):
        return int(value.translate(self.tables))

    def find(self, value):
        count = 0
        key = self.translate_key(value)

        while True:
            h = (HashTable.h1(key) + count * HashTable.h2(key)) % 1046527
            if self.values[h] == value:
                return True
            elif self.values[h] is None:
                return False
            count += 1
        return False

    def insert(self, value):
        count = 0
        key = self.translate_key(value)
        
        while True:
            h = (HashTable.h1(key) + count * HashTable.h2(key)) % 1046527
            if self.values[h] is None:
                self.values[h] = value
                break
            count += 1 class HashTable:

    @staticmethod
    def h1(key):
        return key % 1046527

    @staticmethod
    def h2(key):
        return 1 + (key % (1046527 - 1))
    
    def __init__(self, size):
        self.size = size
        self.values = [None for _ in range(size)]
        self.tables = str.maketrans({
            'A':'1', 'C':'2', 'G':'3', 'T':'4',
        })

    def translate_key(self, value):
        return int(value.translate(self.tables))

    def find(self, value):
        count = 0
        key = self.translate_key(value)

        while True:
            h = (HashTable.h1(key) + count * HashTable.h2(key)) % 1046527
            if self.values[h] == value:
                return True
            elif self.values[h] is None:
                return False
            count += 1
        return False

    def insert(self, value):
        count = 0
        key = self.translate_key(value)
        
        while True:
            h = (HashTable.h1(key) + count * HashTable.h2(key)) % 1046527
            if self.values[h] is None:
                self.values[h] = value
                break
            count += 1 HashTable is_find = dictionary.find(value) dictionary.find(value) is_find command, value = input().split() input().split() command
class HashTable:

    @staticmethod
    def h1(key):
        return key % 1046527

    @staticmethod
    def h2(key):
        return 1 + (key % (1046527 - 1))
    
    def __init__(self, size):
        self.size = size
        self.values = [None for _ in range(size)]
        self.tables = str.maketrans({
            'A':'1', 'C':'2', 'G':'3', 'T':'4',
        })

    def translate_key(self, value):
        return int(value.translate(self.tables))

    def find(self, value):
        count = 0
        key = self.translate_key(value)

        while True:
            h = (HashTable.h1(key) + count * HashTable.h2(key)) % 1046527
            if self.values[h] == value:
                return True
            elif self.values[h] is None:
                return False
            count += 1
        return False

    def insert(self, value):
        count = 0
        key = self.translate_key(value)
        
        while True:
            h = (HashTable.h1(key) + count * HashTable.h2(key)) % 1046527
            if self.values[h] is None:
                self.values[h] = value
                break
            count += 1


num = int(input())

dictionary = HashTable(1046527)
for _ in range(num):
    command, value = input().split()
    if command == "insert":
        dictionary.insert(value)
    elif command == "find":
        is_find = dictionary.find(value)
        print("yes" if is_find else "no")
