# -*- coding:utf-8 -*-
import sys


class Hash(object):
    def __init__(self, size):
        self._array = [None] * size
        self._size = size

    def _hash(self, key):
        return key % self._size

    def insert(self, key, value):
        j = self._hash(key)
        if self._array[j] is None:
            self._array[j] = [value]
        else:
            self._array[j].append(value)

    def find(self, key, value):
        j = self._hash(key)
        if self._array[j] is None:
            return False
        elif value in self._array[j]:
            return True
        else:
            return False


def stoi(s):
    ret = 0
    p = 1
    ctoi = {"A": 1, "C": 2, "G": 3, "T": 4}
    for c in s:
        ret += ctoi[c] * p
        p *= 7
    return ret


def dictionary(lst):
    h = Hash(1046527)
    ret = []
    for val in lst:
        if val[0] == "insert":
            h.insert(stoi(val[1]), val[1])
        elif val[0] == "find":
            if h.find(stoi(val[1]), val[1]):
                ret.append("yes")
            else:
                ret.append("no")
        else:
            raise ValueError
    return ret


if __name__ == "__main__":
    lst = [val.split() for val in sys.stdin.read().splitlines()]
    n = int(lst.pop(0)[0])
    print("\n".join(dictionary(lst))) import sys sys class Hash(object):
    def __init__(self, size):
        self._array = [None] * size
        self._size = size

    def _hash(self, key):
        return key % self._size

    def insert(self, key, value):
        j = self._hash(key)
        if self._array[j] is None:
            self._array[j] = [value]
        else:
            self._array[j].append(value)

    def find(self, key, value):
        j = self._hash(key)
        if self._array[j] is None:
            return False
        elif value in self._array[j]:
            return True
        else:
            return False Hash def __init__(self, size):
        self._array = [None] * size
        self._size = size

     __init__ self._array = [None] * size self._array self _array [None] * size [None] None size self._size = size self._size self _size size self self size size def _hash(self, key):
        return key % self._size

     _hash return key % self._size key % self._size key self._size self _size self self key key def insert(self, key, value):
        j = self._hash(key)
        if self._array[j] is None:
            self._array[j] = [value]
        else:
            self._array[j].append(value)

     insert j = self._hash(key) j self._hash(key) self._hash self _hash key if self._array[j] is None:
            self._array[j] = [value]
        else:
            self._array[j].append(value)

     self._array[j] is None self._array[j] self._array self _array j None self._array[j] = [value] self._array[j] self._array self _array j [value] value self._array[j].append(value) self._array[j].append self._array[j] self._array self _array j append value self self key key value value def find(self, key, value):
        j = self._hash(key)
        if self._array[j] is None:
            return False
        elif value in self._array[j]:
            return True
        else:
            return False find j = self._hash(key) j self._hash(key) self._hash self _hash key if self._array[j] is None:
            return False
        elif value in self._array[j]:
            return True
        else:
            return False self._array[j] is None self._array[j] self._array self _array j None return False False elif value in self._array[j]:
            return True
         value in self._array[j] value self._array[j] self._array self _array j return True True return False False self self key key value value object def stoi(s):
    ret = 0
    p = 1
    ctoi = {"A": 1, "C": 2, "G": 3, "T": 4}
    for c in s:
        ret += ctoi[c] * p
        p *= 7
    return ret stoi ret = 0 ret 0 p = 1 p 1 ctoi = {"A": 1, "C": 2, "G": 3, "T": 4} ctoi {"A": 1, "C": 2, "G": 3, "T": 4} "A" "A" 1 "C" "C" 2 "G" "G" 3 "T" "T" 4 for c in s:
        ret += ctoi[c] * p
        p *= 7
     c s ret += ctoi[c] * p ret ctoi[c] * p ctoi[c] ctoi c p p *= 7 p 7 return ret ret s s def dictionary(lst):
    h = Hash(1046527)
    ret = []
    for val in lst:
        if val[0] == "insert":
            h.insert(stoi(val[1]), val[1])
        elif val[0] == "find":
            if h.find(stoi(val[1]), val[1]):
                ret.append("yes")
            else:
                ret.append("no")
        else:
            raise ValueError
    return ret dictionary h = Hash(1046527) h Hash(1046527) Hash 1046527 ret = [] ret [] for val in lst:
        if val[0] == "insert":
            h.insert(stoi(val[1]), val[1])
        elif val[0] == "find":
            if h.find(stoi(val[1]), val[1]):
                ret.append("yes")
            else:
                ret.append("no")
        else:
            raise ValueError
     val lst if val[0] == "insert":
            h.insert(stoi(val[1]), val[1])
        elif val[0] == "find":
            if h.find(stoi(val[1]), val[1]):
                ret.append("yes")
            else:
                ret.append("no")
        else:
            raise ValueError
     val[0] == "insert" val[0] val 0 "insert" h.insert(stoi(val[1]), val[1]) h.insert h insert stoi(val[1]) stoi val[1] val 1 val[1] val 1 elif val[0] == "find":
            if h.find(stoi(val[1]), val[1]):
                ret.append("yes")
            else:
                ret.append("no")
         val[0] == "find" val[0] val 0 "find" if h.find(stoi(val[1]), val[1]):
                ret.append("yes")
            else:
                ret.append("no")
         h.find(stoi(val[1]), val[1]) h.find h find stoi(val[1]) stoi val[1] val 1 val[1] val 1 ret.append("yes") ret.append ret append "yes" ret.append("no") ret.append ret append "no" raise ValueError ValueError return ret ret lst lst if __name__ == "__main__":
    lst = [val.split() for val in sys.stdin.read().splitlines()]
    n = int(lst.pop(0)[0])
    print("\n".join(dictionary(lst))) __name__ == "__main__" __name__ "__main__" val.split() for val in sys.stdin.read().splitlines() for val in sys.stdin.read().splitlines() val sys.stdin.read().splitlines() sys.stdin.read().splitlines sys.stdin.read() sys.stdin.read sys.stdin sys stdin read splitlines for val in sys.stdin.read().splitlines() val.split() val.split val split lst = [val.split() for val in sys.stdin.read().splitlines()] lst [val.split() for val in sys.stdin.read().splitlines()] n = int(lst.pop(0)[0]) n int(lst.pop(0)[0]) int lst.pop(0)[0] lst.pop(0) lst.pop lst pop 0 0 print("\n".join(dictionary(lst))) print "\n".join(dictionary(lst)) "\n".join "\n" join dictionary(lst) dictionary lst lst = [val.split() for val in sys.stdin.read().splitlines()] [val.split() for val in sys.stdin.read().splitlines()] lst n = int(lst.pop(0)[0]) int(lst.pop(0)[0]) n def stoi(s):
    ret = 0
    p = 1
    ctoi = {"A": 1, "C": 2, "G": 3, "T": 4}
    for c in s:
        ret += ctoi[c] * p
        p *= 7
    return ret def stoi(s):
    ret = 0
    p = 1
    ctoi = {"A": 1, "C": 2, "G": 3, "T": 4}
    for c in s:
        ret += ctoi[c] * p
        p *= 7
    return ret stoi class Hash(object):
    def __init__(self, size):
        self._array = [None] * size
        self._size = size

    def _hash(self, key):
        return key % self._size

    def insert(self, key, value):
        j = self._hash(key)
        if self._array[j] is None:
            self._array[j] = [value]
        else:
            self._array[j].append(value)

    def find(self, key, value):
        j = self._hash(key)
        if self._array[j] is None:
            return False
        elif value in self._array[j]:
            return True
        else:
            return False class Hash(object):
    def __init__(self, size):
        self._array = [None] * size
        self._size = size

    def _hash(self, key):
        return key % self._size

    def insert(self, key, value):
        j = self._hash(key)
        if self._array[j] is None:
            self._array[j] = [value]
        else:
            self._array[j].append(value)

    def find(self, key, value):
        j = self._hash(key)
        if self._array[j] is None:
            return False
        elif value in self._array[j]:
            return True
        else:
            return False Hash def dictionary(lst):
    h = Hash(1046527)
    ret = []
    for val in lst:
        if val[0] == "insert":
            h.insert(stoi(val[1]), val[1])
        elif val[0] == "find":
            if h.find(stoi(val[1]), val[1]):
                ret.append("yes")
            else:
                ret.append("no")
        else:
            raise ValueError
    return ret def dictionary(lst):
    h = Hash(1046527)
    ret = []
    for val in lst:
        if val[0] == "insert":
            h.insert(stoi(val[1]), val[1])
        elif val[0] == "find":
            if h.find(stoi(val[1]), val[1]):
                ret.append("yes")
            else:
                ret.append("no")
        else:
            raise ValueError
    return ret dictionary
# -*- coding:utf-8 -*-
import sys


class Hash(object):
    def __init__(self, size):
        self._array = [None] * size
        self._size = size

    def _hash(self, key):
        return key % self._size

    def insert(self, key, value):
        j = self._hash(key)
        if self._array[j] is None:
            self._array[j] = [value]
        else:
            self._array[j].append(value)

    def find(self, key, value):
        j = self._hash(key)
        if self._array[j] is None:
            return False
        elif value in self._array[j]:
            return True
        else:
            return False


def stoi(s):
    ret = 0
    p = 1
    ctoi = {"A": 1, "C": 2, "G": 3, "T": 4}
    for c in s:
        ret += ctoi[c] * p
        p *= 7
    return ret


def dictionary(lst):
    h = Hash(1046527)
    ret = []
    for val in lst:
        if val[0] == "insert":
            h.insert(stoi(val[1]), val[1])
        elif val[0] == "find":
            if h.find(stoi(val[1]), val[1]):
                ret.append("yes")
            else:
                ret.append("no")
        else:
            raise ValueError
    return ret


if __name__ == "__main__":
    lst = [val.split() for val in sys.stdin.read().splitlines()]
    n = int(lst.pop(0)[0])
    print("\n".join(dictionary(lst)))