import sys

class HashTable:
    def __init__(self):
        self.table = [None] * 4
        self.flag = False

class Dictionary:
    def __init__(self):
        self.hashTable = HashTable()

    def insert(self, key):
        table = self.hashTable
        for c in key:
            hash = self.toHash(c)
            if table.table[hash] is None:
                table.table[hash] = HashTable()
            table = table.table[hash]
        table.flag = True

    def find(self, key):
        table = self.hashTable
        for c in key:
            hash = self.toHash(c)
            if table.table[hash] is None:
                return False
            table = table.table[hash]
        if table.flag:
            return True
        else:
            return False

    def toHash(self, key):
        if key == "A":
            return 0
        elif key == "C":
            return 1
        elif key == "G":
            return 2
        else:
            return 3

if __name__ == "__main__":
    dic = Dictionary()
    lines = sys.stdin.readlines()
    del lines[0]
    for command in lines:
        key = command.split()[1]
        if command[0] == "i":
            dic.insert(key)
        else:
            if dic.find(key):
                print "yes"
            else:
                print "no" import sys sys class HashTable:
    def __init__(self):
        self.table = [None] * 4
        self.flag = False HashTable def __init__(self):
        self.table = [None] * 4
        self.flag = False __init__ self.table = [None] * 4 self.table self table [None] * 4 [None] None 4 self.flag = False self.flag self flag False self self class Dictionary:
    def __init__(self):
        self.hashTable = HashTable()

    def insert(self, key):
        table = self.hashTable
        for c in key:
            hash = self.toHash(c)
            if table.table[hash] is None:
                table.table[hash] = HashTable()
            table = table.table[hash]
        table.flag = True

    def find(self, key):
        table = self.hashTable
        for c in key:
            hash = self.toHash(c)
            if table.table[hash] is None:
                return False
            table = table.table[hash]
        if table.flag:
            return True
        else:
            return False

    def toHash(self, key):
        if key == "A":
            return 0
        elif key == "C":
            return 1
        elif key == "G":
            return 2
        else:
            return 3 Dictionary def __init__(self):
        self.hashTable = HashTable()

     __init__ self.hashTable = HashTable() self.hashTable self hashTable HashTable() HashTable self self def insert(self, key):
        table = self.hashTable
        for c in key:
            hash = self.toHash(c)
            if table.table[hash] is None:
                table.table[hash] = HashTable()
            table = table.table[hash]
        table.flag = True

     insert table = self.hashTable table self.hashTable self hashTable for c in key:
            hash = self.toHash(c)
            if table.table[hash] is None:
                table.table[hash] = HashTable()
            table = table.table[hash]
         c key hash = self.toHash(c) hash self.toHash(c) self.toHash self toHash c if table.table[hash] is None:
                table.table[hash] = HashTable()
             table.table[hash] is None table.table[hash] table.table table table hash None table.table[hash] = HashTable() table.table[hash] table.table table table hash HashTable() HashTable table = table.table[hash] table table.table[hash] table.table table table hash table.flag = True table.flag table flag True self self key key def find(self, key):
        table = self.hashTable
        for c in key:
            hash = self.toHash(c)
            if table.table[hash] is None:
                return False
            table = table.table[hash]
        if table.flag:
            return True
        else:
            return False

     find table = self.hashTable table self.hashTable self hashTable for c in key:
            hash = self.toHash(c)
            if table.table[hash] is None:
                return False
            table = table.table[hash]
         c key hash = self.toHash(c) hash self.toHash(c) self.toHash self toHash c if table.table[hash] is None:
                return False
             table.table[hash] is None table.table[hash] table.table table table hash None return False False table = table.table[hash] table table.table[hash] table.table table table hash if table.flag:
            return True
        else:
            return False

     table.flag table flag return True True return False False self self key key def toHash(self, key):
        if key == "A":
            return 0
        elif key == "C":
            return 1
        elif key == "G":
            return 2
        else:
            return 3 toHash if key == "A":
            return 0
        elif key == "C":
            return 1
        elif key == "G":
            return 2
        else:
            return 3 key == "A" key "A" return 0 0 elif key == "C":
            return 1
         key == "C" key "C" return 1 1 elif key == "G":
            return 2
         key == "G" key "G" return 2 2 return 3 3 self self key key if __name__ == "__main__":
    dic = Dictionary()
    lines = sys.stdin.readlines()
    del lines[0]
    for command in lines:
        key = command.split()[1]
        if command[0] == "i":
            dic.insert(key)
        else:
            if dic.find(key):
                print "yes"
            else:
                print "no" __name__ == "__main__" __name__ "__main__" dic = Dictionary() dic Dictionary() Dictionary lines = sys.stdin.readlines() lines sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines del lines[0] lines[0] lines 0 for command in lines:
        key = command.split()[1]
        if command[0] == "i":
            dic.insert(key)
        else:
            if dic.find(key):
                print "yes"
            else:
                print "no" command lines key = command.split()[1] key command.split()[1] command.split() command.split command split 1 if command[0] == "i":
            dic.insert(key)
        else:
            if dic.find(key):
                print "yes"
            else:
                print "no" command[0] == "i" command[0] command 0 "i" dic.insert(key) dic.insert dic insert key if dic.find(key):
                print "yes"
            else:
                print "no" dic.find(key) dic.find dic find key print print dic = Dictionary() Dictionary() dic lines = sys.stdin.readlines() sys.stdin.readlines() lines class HashTable:
    def __init__(self):
        self.table = [None] * 4
        self.flag = False class HashTable:
    def __init__(self):
        self.table = [None] * 4
        self.flag = False HashTable class Dictionary:
    def __init__(self):
        self.hashTable = HashTable()

    def insert(self, key):
        table = self.hashTable
        for c in key:
            hash = self.toHash(c)
            if table.table[hash] is None:
                table.table[hash] = HashTable()
            table = table.table[hash]
        table.flag = True

    def find(self, key):
        table = self.hashTable
        for c in key:
            hash = self.toHash(c)
            if table.table[hash] is None:
                return False
            table = table.table[hash]
        if table.flag:
            return True
        else:
            return False

    def toHash(self, key):
        if key == "A":
            return 0
        elif key == "C":
            return 1
        elif key == "G":
            return 2
        else:
            return 3 class Dictionary:
    def __init__(self):
        self.hashTable = HashTable()

    def insert(self, key):
        table = self.hashTable
        for c in key:
            hash = self.toHash(c)
            if table.table[hash] is None:
                table.table[hash] = HashTable()
            table = table.table[hash]
        table.flag = True

    def find(self, key):
        table = self.hashTable
        for c in key:
            hash = self.toHash(c)
            if table.table[hash] is None:
                return False
            table = table.table[hash]
        if table.flag:
            return True
        else:
            return False

    def toHash(self, key):
        if key == "A":
            return 0
        elif key == "C":
            return 1
        elif key == "G":
            return 2
        else:
            return 3 Dictionary key = command.split()[1] command.split()[1] key
import sys

class HashTable:
    def __init__(self):
        self.table = [None] * 4
        self.flag = False

class Dictionary:
    def __init__(self):
        self.hashTable = HashTable()

    def insert(self, key):
        table = self.hashTable
        for c in key:
            hash = self.toHash(c)
            if table.table[hash] is None:
                table.table[hash] = HashTable()
            table = table.table[hash]
        table.flag = True

    def find(self, key):
        table = self.hashTable
        for c in key:
            hash = self.toHash(c)
            if table.table[hash] is None:
                return False
            table = table.table[hash]
        if table.flag:
            return True
        else:
            return False

    def toHash(self, key):
        if key == "A":
            return 0
        elif key == "C":
            return 1
        elif key == "G":
            return 2
        else:
            return 3

if __name__ == "__main__":
    dic = Dictionary()
    lines = sys.stdin.readlines()
    del lines[0]
    for command in lines:
        key = command.split()[1]
        if command[0] == "i":
            dic.insert(key)
        else:
            if dic.find(key):
                print "yes"
            else:
                print "no"