CodeEff/ECCO huggingface dataset:
# Original solution
# -*- coding: utf-8 -*-

class HashTable(list):
    def __init__(self, length):
        list.__init__(self)
        self.length = length
        self[:] = [None] * length

    def h(self, key, i):
        h1 = key % self.length
        h2 = 1 + (key % (self.length - 1))
        return (h1 + i*h2) % self.length

    def insert(self, key):
        i = 0
        while True:
            #print(i)
            j = self.h(key, i)
            if self[j] is None:
                self[j] = key
                return j
            else:
                i += 1
    
    def search(self, key):
        i = 0
        while True:
            #print(i)
            j = self.h(key, i)
            if self[j] == key:
                return j
            elif self[j] is None or i >= self.length:
                return None
            else:
                i += 1

def getNum(char):
    char2num = str.maketrans("ACGT", "1234")
    return int(char.translate(char2num), 5)

if __name__ == '__main__':

    n = int(eval(input()))
    T = HashTable(1046527)
    C = [input().split(" ") for i in range(n)]
    
    for command, char in C:
        num = getNum(char)
        if command[0] == "i":
            T.insert(num)
        else:
            if T.search(num) is None:
                print("no")
            else:
                print("yes")


# Optimized solution
# -*- coding: utf-8 -*-

class HashTable(list):
    def __init__(self, length):
        list.__init__(self)
        self.length = length
        self[:] = [None] * length

    def h(self, key, i):
        h1 = key % self.length
        h2 = 1 + (key % (self.length - 1))
        return (h1 + i*h2) % self.length

    def insert(self, key):
        i = 0
        while True:
            h1 = key % self.length
            h2 = 1 + (key % (self.length - 1))
            j = (h1 + i*h2) % self.length
            #j = self.h(key, i)
            if self[j] is None:
                self[j] = key
                return j
            else:
                i += 1
    
    def search(self, key):
        i = 0
        while True:
            h1 = key % self.length
            h2 = 1 + (key % (self.length - 1))
            j = (h1 + i*h2) % self.length
            #j = self.h(key, i)
            if self[j] == key:
                return j
            elif self[j] is None or i >= self.length:
                return None
            else:
                i += 1

def getNum(char):
    char2num = str.maketrans("ACGT", "1234")
    return int(char.translate(char2num), 5)

if __name__ == '__main__':

    n = int(eval(input()))
    T = HashTable(1046527)
    C = [input().split(" ") for i in range(n)]
    
    for command, char in C:
        num = getNum(char)
        if command[0] == "i":
            T.insert(num)
        else:
            if T.search(num) is None:
                print("no")
            else:
                print("yes")
# Original solution
import sys

n = int(eval(input()))

dct = []

for line in sys.stdin:

    cmd, val = line.strip().split()

    if cmd == 'insert':
        dct.append(val)

    else:
        if val in dct:
            print('yes')
        else:
            print('no')



# Optimized solution
import sys

n = int(eval(input()))
dct = set()

for line in sys.stdin:

    cmd, val = line.strip().split()

    if cmd == 'insert':
        dct.add(val)

    else:
        if val in dct:
            print('yes')
        else:
            print('no')
# Original solution
import sys

n = int(eval(input()))
htable = [0 for _ in range(16777216)]


def to_int(s):
    if s == 'A':
        return 1
    elif s == 'C':
        return 2
    elif s == 'G':
        return 3
    else:
        return 4


def to_hash(string):
    h = 0
    for i, s in enumerate(string):
        ints = to_int(s)
        h += 4**i * ints

    return h


def insert(string):
    h = to_hash(string)
    htable[h] = 1


def find(string):
    h = to_hash(string)
    if htable[h]:
        print('yes')
    else:
        print('no')


for line in sys.stdin:
    cmd, string = line.strip().split()

    if cmd == 'insert':
        insert(string)

    else:
        find(string)



# Optimized solution
import sys

htable = [0] * 16777216


def to_int(s):
    if s == 'A':
        return 1
    elif s == 'C':
        return 2
    elif s == 'G':
        return 3
    else:
        return 4


def to_hash(string):
    h = 0
    for i, s in enumerate(string):
        ints = to_int(s)
        h += 4**i * ints

    return h


def insert(string):
    h = to_hash(string)
    htable[h] = 1


def find(string):
    h = to_hash(string)
    if htable[h]:
        print('yes')
    else:
        print('no')


if __name__ == '__main__':

    n = int(eval(input()))

    for line in sys.stdin:
        cmd, string = line.strip().split()

        if cmd == 'insert':
            insert(string)

        else:
            find(string)
# Original solution
from collections import deque
import bisect
n = int(eval(input()))
d = []
for i in range(n):
    c, s = input().split()
    if c == "insert":
        d.insert(bisect.bisect_left(d, s), s)
    else:
        j = bisect.bisect_left(d, s)
        if j < len(d) and d[j] == s:
            print("yes")
        else:
            print("no")


# Optimized solution
n = int(eval(input()))
d = {}
for i in range(n):
    c, s = input().split()
    if c == "insert":
        d[s] = 0
    else:
        if s in d:
            print("yes")
        else:
            print("no")
# Original solution
def binary_search(dic, word, imin, imax):
    if imax < imin:
        return "no"
    imid = imin + (imax - imin) // 2
    if dic[imid] > word:
        return binary_search(dic, word, imin, imid - 1)
    elif dic[imid] < word:
        return binary_search(dic, word, imid + 1, imax)
    else:
        return "yes"


n = int(eval(input()))
dictionary = []

for _ in range(n):
    cmd, arg = input().split()
    if cmd == "insert":
        dictionary.append(arg)
        dictionary.sort()
    elif cmd == "find":
        print((binary_search(dictionary, arg, 0, len(dictionary) - 1)))

# Optimized solution
n = int(eval(input()))
dictionary = set()

for _ in range(n):
    cmd, arg = input().split()
    if cmd == "insert":
        dictionary.add(arg)
    elif cmd == "find":
        if arg in dictionary:
            print("yes")
        else:
            print("no")
# Original solution
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_C&lang=jp
#??????
if __name__ == "__main__":
    n_line = int(eval(input()))
    input_list = [tuple(input().split()) for i in range(n_line)]
    l = []
    for c, s in input_list:
        if c == "insert":
            l.append(s)
        else:
            if s in l:
                print("yes")
            else:
                print("no")

# Optimized solution
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_C&lang=jp
#??????
if __name__ == "__main__":
    n_line = int(eval(input()))
    input_list = [tuple(input().split()) for i in range(n_line)]
    l = set([])
    for c, s in input_list:
        if c == "insert":
            l.add(s)
        else:
            if s in l:
                print("yes")
            else:
                print("no")
# Original solution
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_C&lang=jp
#??????
if __name__ == "__main__":
    n_line = int(eval(input()))
    input_list = [tuple(input().split()) for i in range(n_line)]
    dict_list = [s if c == "insert" else "" for c, s in input_list ]
    search_list = [(i,l[1]) for i,l in enumerate(input_list) if l[0] == "find"]
    ans_list = ["yes" if s in dict_list[:i] else "no" for i, s in search_list]
    print(("\n".join(ans_list)))

# Optimized solution
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_C&lang=jp
#??????
if __name__ == "__main__":
    n_line = int(eval(input()))
    input_list = [tuple(input().split()) for i in range(n_line)]
    l = set([])
    for c, s in input_list:
        if c == "insert":
            l.add(s)
        else:
            if s in l:
                print("yes")
            else:
                print("no")
# Original solution
class Dict(object):

    m1 = 2 ** 24 - 1
    m2 = 3

    def __init__(self):
        self._dict = ["" for _ in range(self.m1)]

    def insert(self, k):
        i = 0

        while True:
            ix = self._h(k, i)
            if self._dict[ix] == "":
                self._dict[ix] = k
                return
            else:
                i += 1

    def find(self, k):
        i = 0

        while True:
            ix = self._h(k, i)
            if self._dict[ix] == k:
                return ix
            elif self._dict[ix] == "":
                return -1
            else:
                i += 1

    def _h(self, k, i):
        return self._h1(k) + i * self._h2(k)

    def _h1(self, k):
        return k % self.m1

    def _h2(self, k):
        return k % self.m2 + 1


def to_int(s):
    _s = s[::]

    ret = 0
    i = 1
    for e in _s:
        if e == 'A':
            ret += 1 * i
        elif e == 'C':
            ret += 2 * i
        elif e == 'G':
            ret += 3 * i
        elif e == 'T':
            ret += 4 * i
        i *= 4

    return ret


if __name__ == '__main__':
    n = int(eval(input()))

    d = Dict()

    for _ in range(n):
        cmd, val = input().split()

        if cmd == "insert":
            d.insert(to_int(val))
        else:
            ans = "yes" if d.find(to_int(val)) != -1 else "no"
            print(ans)

# Optimized solution
class Dict(object):

    m1 = 2 ** 24 - 1
    m2 = m1 - 1

    def __init__(self):
        self._dict = ["" for _ in range(self.m1)]

    def insert(self, k):
        i = 0

        while True:
            ix = self._h(k, i)
            if self._dict[ix] == "":
                self._dict[ix] = k
                return
            else:
                i += 1

    def find(self, k):
        i = 0

        while True:
            ix = self._h(k, i)
            if self._dict[ix] == k:
                return ix
            elif self._dict[ix] == "":
                return -1
            else:
                i += 1

    def _h(self, k, i):
        return self._h1(k) + i * self._h2(k)

    def _h1(self, k):
        return k % self.m1

    def _h2(self, k):
        return k % self.m2 + 1


def to_int(s):
    _s = s[::]

    ret = 0
    i = 1
    for e in _s:
        if e == 'A':
            ret += 1 * i
        elif e == 'C':
            ret += 2 * i
        elif e == 'G':
            ret += 3 * i
        elif e == 'T':
            ret += 4 * i
        i *= 4

    return ret


if __name__ == '__main__':
    n = int(eval(input()))

    d = Dict()

    for _ in range(n):
        cmd, val = input().split()

        if cmd == "insert":
            d.insert(to_int(val))
        else:
            ans = "yes" if d.find(to_int(val)) != -1 else "no"
            print(ans)
# Original solution
class Dict(object):

    m1 = 1046527
    m2 = m1 - 1

    def __init__(self):
        self._dict = ["" for _ in range(self.m1)]

    def insert(self, k):
        i = 0

        while True:
            ix = self._h(k, i)
            if self._dict[ix] == "":
                self._dict[ix] = k
                return
            else:
                i += 1

    def find(self, k):
        i = 0

        while True:
            ix = self._h(k, i)
            if self._dict[ix] == k:
                return ix
            elif self._dict[ix] == "":
                return -1
            else:
                i += 1

    def _h(self, k, i):
        return (self._h1(k) + i * self._h2(k)) % self.m1

    def _h1(self, k):
        return k % self.m1

    def _h2(self, k):
        return k % self.m2 + 1


def to_int(s):
    ret = 0
    i = 1
    for j in range(len(s)):
        e = s[len(s) - j - 1]

        if e == 'A':
            ret += 1 * i
        elif e == 'C':
            ret += 2 * i
        elif e == 'G':
            ret += 3 * i
        elif e == 'T':
            ret += 4 * i
        i *= 4

    return ret


if __name__ == '__main__':
    n = int(eval(input()))

    d = Dict()

    for _ in range(n):
        cmd, val = input().split()

        if cmd == "insert":
            d.insert(to_int(val))
        else:
            ans = "yes" if d.find(to_int(val)) != -1 else "no"
            print(ans)

# Optimized solution
class Dict(object):

    m1 = 1046527
    m2 = m1 - 1

    def __init__(self):
        self._dict = ["" for _ in range(self.m1)]

    def insert(self, k):
        i = 0

        while True:
            ix = self._h(k, i)
            if self._dict[ix] == "":
                self._dict[ix] = k
                return
            else:
                i += 1

    def find(self, k):
        i = 0

        while True:
            ix = self._h(k, i)
            if self._dict[ix] == k:
                return ix
            elif self._dict[ix] == "":
                return -1
            else:
                i += 1

    def _h(self, k, i):
        return (self._h1(k) + i * self._h2(k)) % self.m1

    def _h1(self, k):
        return k % self.m1

    def _h2(self, k):
        return k % self.m2 + 1


def to_int(s):
    ret = 0
    i = 1
    for j in range(len(s)):
        e = s[len(s) - j - 1]

        if e == 'A':
            ret += 1 * i
        elif e == 'C':
            ret += 2 * i
        elif e == 'G':
            ret += 3 * i
        elif e == 'T':
            ret += 4 * i
        i *= 5

    return ret


if __name__ == '__main__':
    n = int(eval(input()))

    d = Dict()

    for _ in range(n):
        cmd, val = input().split()

        if cmd == "insert":
            d.insert(to_int(val))
        else:
            ans = "yes" if d.find(to_int(val)) != -1 else "no"
            print(ans)
# Original solution
class Dict(object):

    m1 = 1046527
    m2 = m1 - 1

    def __init__(self):
        self._dict = [""] * self.m1

    def insert(self, k):
        i = 0

        while True:
            ix = self._h(k, i)
            if self._dict[ix] == "":
                self._dict[ix] = k
                return
            else:
                i += 1

    def find(self, k):
        i = 0

        while True:
            ix = self._h(k, i)
            if self._dict[ix] == k:
                return True
            elif self._dict[ix] == "":
                return False
            else:
                i += 1

        return False

    def _h(self, k, i):
        return (self._h1(k) + i * self._h2(k)) % self.m1

    def _h1(self, k):
        return k % self.m1

    def _h2(self, k):
        return k % self.m2 + 1


def to_int(s):
    ret = 0
    i = 1
    for j in range(len(s)):
        e = s[len(s) - j - 1]

        if e == 'A':
            ret += 1 * i
        elif e == 'C':
            ret += 2 * i
        elif e == 'G':
            ret += 3 * i
        elif e == 'T':
            ret += 4 * i
        i *= 5

    return ret


if __name__ == '__main__':
    n = int(eval(input()))

    d = Dict()

    for _ in range(n):
        cmd, val = input().split()

        if cmd == "insert":
            d.insert(to_int(val))
        else:
            ans = "yes" if d.find(to_int(val)) else "no"
            print(ans)

# Optimized solution
class Dict(object):

    m1 = 1046527
    m2 = m1 - 1

    def __init__(self):
        self._dict = [""] * self.m1

    def insert(self, k):
        i = 0

        while True:
            ix = self._h(k, i)
            if self._dict[ix] == "":
                self._dict[ix] = k
                return
            else:
                i += 1

    def find(self, k):
        i = 0

        while True:
            ix = self._h(k, i)
            if self._dict[ix] == k:
                return True
            elif self._dict[ix] == "":
                return False
            else:
                i += 1

        return False

    def _h(self, k, i):
        return (self._h1(k) + i * self._h2(k)) % self.m1

    def _h1(self, k):
        return k % self.m1

    def _h2(self, k):
        return k % self.m2 + 1


def to_int(s):
    ret = 0
    i = 1
    for j in range(len(s)):
        e = s[len(s) - j - 1]

        if e == 'A':
            ret += 1 * i
        elif e == 'C':
            ret += 2 * i
        elif e == 'G':
            ret += 3 * i
        elif e == 'T':
            ret += 4 * i
        i *= 5

    return ret


if __name__ == '__main__':
    n = int(eval(input()))

    d = Dict()

    for _ in range(n):
        cmd, val = input().split()

        if cmd[0] == "i":
            d.insert(to_int(val))
        else:
            ans = "yes" if d.find(to_int(val)) else "no"
            print(ans)
# Original solution
m1 = 1046527
m2 = m1 - 1
_dict = [""] * m1


def insert(k):
    i = 0

    while True:
        ix = _h(k, i)
        if _dict[ix] == "":
            _dict[ix] = k
            return
        else:
            i += 1


def find(k):
    i = 0

    while True:
        ix = _h(k, i)
        if _dict[ix] == k:
            return True
        elif _dict[ix] == "":
            return False
        else:
            i += 1

    return False


def _h(k, i):
    return (_h1(k) + i * _h2(k)) % m1


def _h1(k):
    return k % m1


def _h2(k):
    return k % m2 + 1


def to_int(s):
    ret = 0
    i = 1
    for j in range(len(s)):
        e = s[len(s) - j - 1]

        if e == 'A':
            ret += 1 * i
        elif e == 'C':
            ret += 2 * i
        elif e == 'G':
            ret += 3 * i
        elif e == 'T':
            ret += 4 * i
        i *= 5

    return ret


if __name__ == '__main__':
    n = int(eval(input()))

    for _ in range(n):
        cmd, val = input().split()

        if cmd[0] == "i":
            insert(to_int(val))
        else:
            ans = "yes" if find(to_int(val)) else "no"
            print(ans)

# Optimized solution
m1 = 1046527
_dict = [""] * m1


def insert(k):
    i = 0

    while True:
        ix = _h(k, i)
        if _dict[ix] == "":
            _dict[ix] = k
            return
        else:
            i += 1


def find(k):
    i = 0

    while True:
        ix = _h(k, i)
        if _dict[ix] == k:
            return True
        elif _dict[ix] == "":
            return False
        else:
            i += 1

    return False


def _h(k, i):
    return ((k % m1) + i * (1 + k % (m1 - 1))) % m1


def to_int(s):
    ret = 0
    i = 1
    for j in range(len(s)):
        e = s[len(s) - j - 1]

        if e == 'A':
            ret += 1 * i
        elif e == 'C':
            ret += 2 * i
        elif e == 'G':
            ret += 3 * i
        elif e == 'T':
            ret += 4 * i
        i *= 5

    return ret


if __name__ == '__main__':
    n = int(eval(input()))

    for _ in range(n):
        cmd, val = input().split()

        if cmd[0] == "i":
            insert(to_int(val))
        else:
            ans = "yes" if find(to_int(val)) else "no"
            print(ans)
# Original solution
m1 = 1046527
_dict = [""] * m1


def insert(k):
    i = 0

    while True:
        ix = _h(k, i)
        if _dict[ix] == "":
            _dict[ix] = k
            return
        else:
            i += 1


def find(k):
    i = 0

    while True:
        ix = _h(k, i)
        if _dict[ix] == k:
            return True
        elif _dict[ix] == "":
            return False
        else:
            i += 1

    return False


def _h(k, i):
    return ((k % m1) + i * (1 + k % (m1 - 1))) % m1




def getChar(ch):
    if ch == 'A':
        return 1
    elif ch == 'C':
        return 2
    elif ch == 'G':
        return 3
    elif ch == 'T':
        return 4
    else:
        return 0

def getKey(strings):
    Sum = 0
    p = 1
    for i in range(len(strings)):
        Sum += p * getChar(strings[i])
        p *= 5

    return Sum


def to_int(s):
    ret = 0
    i = 1
    for j in range(len(s)):
        e = s[len(s) - j - 1]

        if e == 'A':
            ret += 1 * i
        elif e == 'C':
            ret += 2 * i
        elif e == 'G':
            ret += 3 * i
        elif e == 'T':
            ret += 4 * i
        i *= 5

    return ret


if __name__ == '__main__':
    n = int(eval(input()))

    for _ in range(n):
        cmd, val = input().split()

        if cmd[0] == "i":
            insert(getKey(val))
        else:
            ans = "yes" if find(getKey(val)) else "no"
            print(ans)

# Optimized solution
M = 1046527
L = 14
H = [""] * M
 
def getChar(ch):
    if ch == 'A':
        return 1
    elif ch == 'C':
        return 2
    elif ch == 'G':
        return 3
    elif ch == 'T':
        return 4
    else:
        return 0
 
def getKey(strings):
    Sum = 0
    p = 1
    for i in range(len(strings)):
        Sum += p * getChar(strings[i])
        p *= 5
 
    return Sum
 
def h1(key):
    return key % M
 
def h2(key):
    return 1 + (key % (M-1))
 
def find(strings):
    key = getKey(strings)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == strings:
            return 1
        elif len(H[h]) == 0:
            return 0
        else:
            i += 1
    return 0
 
def insert(strings):
    key = getKey(strings)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == strings:
            return 1
        elif len(H[h]) == 0:
            H[h] = strings
            return 0
        else:
            i += 1
    return 0
 
def main():
    n = eval(input())
    for i in range(n):
        com = input().split()
        if com[0][0] == 'i':
            insert(com[1])
        else:
            if find(com[1]):
                print('yes')
            else:
                print('no')
    return 0
 
main()
# Original solution
class Node():
    def __init__(self, data):
        # string
        self.data = data
        self.children = dict()
        
class Tries():
    def __init__(self):
        self.head = Node("*")

    def add(self, string):
        nodelist = [Node(char) for char in string]
        cur_node = self.head
        for node in nodelist:
            char = node.data
            if char not in cur_node.children:
                cur_node.children[char] = node
                cur_node = cur_node.children[char]
            else:
                cur_node = cur_node.children[char]
        cur_node.children["*"] = 0

    def _add(self, string):
        '''
        deprecated
        '''
        
        nodelist = [Node(char) for char in string]
        cur_node = self.head
        i = 0
        
        while(i < len(nodelist)):
            node = nodelist[i]
            char = node.data
            
            if char not in cur_node.children:
                cur_node.children[char] = nodelist[i]
                cur_node = cur_node.children[char]

            else:
                # cur_node.children[char]
                cur_node = cur_node.children[char]

            i += 1
            
    def find(self, string):
        i = 0
        cur_node = self.head
        while(i <= len(string)-1):
            
            char = string[i]
            if char in cur_node.children:
                cur_node = cur_node.children[char]
                i += 1
            else:
                return False
        if cur_node.children.get("*") == None:
            return False
        return True
                
if __name__ == "__main__":
    
    n = int(eval(input()))
    ops = []
    words = []
    for _ in range(n):
        op, word = input().split()
        ops.append(op)
        words.append(word)
    
    tries = Tries()
    for op, word in zip(ops, words):
        if op=='insert':
            tries.add(word)
        else:
            if tries.find(word)==True:
                print("yes")
            else:
                print("no")



# Optimized solution
if __name__ == "__main__":
    
    n = int(eval(input()))
    ops = []
    words = []
    for _ in range(n):
        op, word = input().split()
        ops.append(op)
        words.append(word)
    
    db = set()
    for op, word in zip(ops, words):
        if op=='insert':
            db.add(word)
        else:
            if word in db:
                print("yes")
            else:
                print("no")