CodeEff/ECCO huggingface dataset:
# Original solution
n = int(eval(input()))

class Hash:
    def __init__(self):
        self.m = 1000003
        self.T = [None] * self.m
    def insert(self, key):
        i = 0
        while True:
            j = self.h(key, i)
            if self.T[j] == None:
                self.T[j] = key
                break
            else:
                i = i + 1
    def search(self, key):
        i = 0
        while True:
            j = self.h(key, i)
            if self.T[j] == key:
                return j
            elif self.T[j] == None:
                return None
            else:
                i += 1
        return self.T[self.h(key)]
    def h(self, key, i):
        ki = self.key2int(key)
        h1 = ki % self.m
        h2 = i * (1 + (ki % (self.m - 1)))
        return (h1 + h2) % self.m
    def key2int(self, key):
        p = 1
        ret = 0
        for s in key:
            a = ['A', 'C', 'G', 'T'].index(s) + 1
            ret += p * a
            p *= 5
        return ret

h = Hash()
for i in range(n):
    op, st = input().split()
    if op == 'insert':
        h.insert(st)
    else:
        if h.search(st):
            print('yes')
        else:
            print('no')

# Optimized solution
n = int(eval(input()))
h = {}

for i in range(n):
    op, st = input().split()
    if op == 'insert':
        h[st] = 'yes'
    else:
        print((h.get(st, 'no')))
# Original solution
import sys


def main():
    _ = int(eval(input()))

    imps = sys.stdin.readlines()

    db = []
    for imp in imps:
        command = imp.split(' ')
        if command[0] == 'insert':
            db.append(command[1])
        else:
            if command[1] in db:
                print('yes')
            else:
                print('no')


main()

# Optimized solution
import sys
 
n = int(eval(input()))
dic = {}
input_ = sys.stdin.readlines()
 
for i in input_:
    c, s = i.split()
    if c == 'insert':
        dic[s] = 0
    else:
        if s in dic:
            print('yes')
        else:
            print('no')
# Original solution
from collections import deque
n = int(eval(input()))
l = deque()
for _ in range(n):
    ss = input().split()
    order, string = ss[0], ss[1]
    if order == "insert":
        l.append(string)
    else:
        print(('yes' if string in l else 'no'))

# Optimized solution
n = int(eval(input()))
l = {}
for _ in range(n):
    ss = input().split()
    order, string = ss[0], ss[1]
    if order == "insert":
        l[string] = 1
    else:
        print(('yes' if string in l else 'no'))
# Original solution
n = int(eval(input()))

strs = []

for i in range(n):
    s = input().split()
    if(s[0] == 'insert'):
        if(s[1] not in strs):
            strs.append(s[1])
    else:
        if(s[1] in strs):
            print('yes')
        else:
            print('no')


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

strs = {}

for i in range(n):
    s = input().split()
    if(s[0] == 'insert'):
        if(s[1] not in strs):
            strs[s[1]] = ''
    else:
        if(s[1] in strs):
            print('yes')
        else:
            print('no')
# Original solution
from collections import deque

D = deque()
N = int(eval(input()))

for i in range(N):
	c, s = input().split()
	if c == "insert":
		D.append(s)
	elif c == "find":
		if (s in D):
			print("yes")
		else:
			print("no")

# Optimized solution
from collections import deque

D = set()
N = int(eval(input()))

for i in range(N):
	c, s = input().split()
	if c == "insert":
		D.add(s)
	elif c == "find":
		if (s in D):
			print("yes")
		else:
			print("no")
# Original solution
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):
        key = key.replace("A", "0")
        key = key.replace("C", "1")
        key = key.replace("G", "2")
        key = key.replace("T", "3")
        return int(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")

# Optimized solution
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")
# Original solution
n = int(eval(input()))
M = 1046527
a = [0 for i in range(M)]
for i in range(n):
    s = input().split(" ")
    num = 0
    p = 1
    for j in range(len(s[1])):
        if s[1][j] == "A":
            num += p * 1
        elif s[1][j] == "C":
            num += p * 2
        elif s[1][j] == "G":
            num += p * 3
        else:
            num += p * 4
        p *= 5
    h1 = num % M
    h2 = h1 + num % (M - 1)
    k = 0
    if s[0][0] == "i":
        while True:
            h = (h1 + k * h2) % M
            if a[h] == 0:
                a[h] = s[1]
                break
            elif a[h] == s[1]:
                break
            else:
                k += 1
    else:
        while True:
            h = (h1 + k * h2) % M
            if a[h] == s[1]:    
                print("yes")
                break
            elif a[h] == 0:
                print("no")
                break
            else:
                k += 1

# Optimized solution
n = int(eval(input()))
dic = set()
for i in range(n):
    Cmd, Key = input().split(" ")
    if Cmd == "insert":
	    dic.add(Key)
    else:
        if Key in dic:
	        print("yes")
        else:
            print("no")
# Original solution
n = int( eval(input( )) )
dic = {}
output = []
for i in range( n ):
	cmd, word = input( ).split( " " )
	if "insert" == cmd:
		dic[ word ] = True
	elif "find" == cmd:
		if not dic.get( word ):
			output.append( "no" )
		else:
			output.append( "yes" )

print(( "\n".join( output ) ))

# Optimized solution
n = int( input( ) )
dic = {}
for i in range( n ):
	cmd, word = input( ).split( " " )
	if "insert" == cmd:
		dic[ word ] = True
	elif "find" == cmd:
		if not dic.get( word ):
			print( "no" )
		else:
			print( "yes" )
# Original solution
n = int( input( ) )
dic = {}
for i in range( n ):
	cmd, word = input( ).split( " " )
	if "insert" == cmd:
		dic[ word ] = True
	elif "find" == cmd:
		if not dic.get( word ):
			print( "no" )
		else:
			print( "yes" )

# Optimized solution
n = int( input( ) )
dic = {}
for i in range( n ):
	cmd, word = input( ).split( " " )
	if "insert" == cmd:
		dic[ word ] = True
	elif "find" == cmd:
		if word in dic:
			print( "yes" )
		else:
			print( "no" )
# Original solution
def binarySearch(array, key):
    left = 0
    right = len(array)
    while left < right:
        mid = int((left + right) / 2)
        if key == array[mid]:
            return True
        elif key > array[mid]:
            left = mid + 1
        elif key < array[mid]:
            right = mid
        else:
            print("ERROR")
    return False


def convertor(string):
    result = ""
    for s in string:
        if s == 'A':
            result += "1"
        elif s == 'C':
            result += "2"
        elif s == 'G':
            result += "3"
        elif s == 'T':
            result += "4"
        else:
            print("ERROR")
    return eval(result)


n = int(eval(input()))
d = []
for i in range(n):
    cmd, string = input().split()
    string = convertor(string)
    if cmd == "insert":
        d.append(string)
    else:
        if binarySearch(sorted(d), string):
            print("yes")
        else:
            print("no")


# Optimized solution
n = int(eval(input()))
d = {}
for i in range(n):
    cmd, string = input().split()
    if cmd == "insert":
        d[string] = True
    else:
        try:
            if d[string]:
                print("yes")
        except:
            print("no")
# Original solution
#! /usr/bin/env python
# -*- coding: utf-8 -*-

''' ?????? '''


class Dictionary(object):
    """ Dictionary """

    def __init__(self):
        self.dict = []

    def insert(self, x):
        self.dict.append(x)

    def find(self, x):
        if x in self.dict:
            print('yes')
        else:
            print('no')

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

    d = Dictionary()

    for _ in range(N):
        command, key = list(input().split())
        if command == 'insert':
            d.insert(key)
        elif command == 'find':
            d.find(key)

# Optimized solution
#! /usr/bin/env python
# -*- coding: utf-8 -*-

''' ?????? '''


class Dictionary(object):
    """ Dictionary """

    def __init__(self):
        self.dict = {}

    def insert(self, x):
        self.dict[x] = 0

    def find(self, x):
        if x in list(self.dict.keys()):
            print('yes')
        else:
            print('no')

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

    d = Dictionary()

    for _ in range(N):
        command, key = list(input().split())
        if command == 'insert':
            d.insert(key)
        elif command == 'find':
            d.find(key)
# Original solution
class Dictionary:
    def __init__(self):
        self.dic = []
    def insert(self, key):
        self.dic.append(key)
    def find(self, key):
        return key in self.dic

dic = Dictionary()
n = int(eval(input()))
for i in range(n):
    cmd = input().split()
    if cmd[0] == "insert":
        dic.insert(cmd[1])
    elif cmd[0] == "find":
        if dic.find(cmd[1]):
            print("yes")
        else:
            print("no")
    else:
        print("wrong command")


# Optimized solution
dic = set()
n = int(eval(input()))
for i in range(n):
    cmd, val = input().split()
    if cmd == "insert":
        dic.add(val)
    elif cmd == "find":
        print(("yes" if val in dic else "no"))
    else:
        print("wrong command")
# Original solution
dict = {"A":1,"C":2,"G":3,"T":4}
def a2n(a):
	ans = 0
	for i in range(len(a)):
		ans += dict[a[i]]*4**i
	return ans
	
n = int(input())
ls = [0 for i in range(6710886)]
for i in range(n):
    inp = input()
    if inp[0] == "i":
        ls[a2n(inp[7:])] = 1
    else:
        print("yes" if ls[a2n(inp[5:])] else "no")
            

# Optimized solution
dict = {"A":1,"C":2,"G":3,"T":4}
def a2n(a):
	ans = 0
	for i in range(len(a)):
		ans += dict[a[i]]*4**i
	return ans
	
n = int(input())
ls = [0 for i in range(3000000)]
for i in range(n):
    inp = input()
    if inp[0] == "i":
        ls[a2n(inp[7:])] = 1
    else:
        print("yes" if ls[a2n(inp[5:])] else "no")
# Original solution
dict = {"A":1,"C":2,"G":3,"T":4}
def a2n(a):
	ans = 0
	for i in range(len(a)):
		ans += dict[a[i]]*4**i
	return ans
	
n = int(input())
ls = [0 for i in range(3000000)]
for i in range(n):
    inp = input()
    if inp[0] == "i":
        ls[a2n(inp[7:])] = 1
    else:
        print("yes" if ls[a2n(inp[5:])] else "no")
            

# Optimized solution
n = int(input())
ls = {}
for i in range(n):
    inp = input()
    if inp[0] == "i":
        ls[inp[7:]] = 1
    else:
        try:
        	if ls[inp[5:]] == 1: print("yes")
        except:
        	print("no")
# Original solution
# -*- coding: utf-8 -*-

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

    def h1(self, key):
        return key % self.length

    def h2(self, key):
        return 1 + (key % (self.length - 1))

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

    def insert(self, key):
        i = 0
        while True:
            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:
            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



if __name__ == '__main__':

    n = int(eval(input()))
    T = HashTable(n)
    char2num = str.maketrans("ACGT", "1234")

    for _ in range(n):
        command, char = input().split(" ")
        num = int(char.translate(char2num))
        if command == "insert":
            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 h1(self, key):
        return key % self.length

    def h2(self, key):
        return 1 + (key % (self.length - 1))

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

    def insert(self, key):
        i = 0
        while True:
            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:
            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))

if __name__ == '__main__':

    n = int(eval(input()))
    T = HashTable(n)
    C = [input().split(" ") for i in range(n)]
    
    C = [(x[0], getNum(x[1])) for x in C]
    
    for command, num in C:
        if command == "insert":
            T.insert(num)
        else:
            if T.search(num) is None:
                print("no")
            else:
                print("yes")
# Original solution
# -*- coding: utf-8 -*-

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

    def h1(self, key):
        return key % self.length

    def h2(self, key):
        return 1 + (key % (self.length - 1))

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

    def insert(self, key):
        i = 0
        while True:
            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:
            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))

if __name__ == '__main__':

    n = int(eval(input()))
    T = HashTable(n)
    C = [(x[0], getNum(x[1])) for x in [input().split(" ") for i in range(n)]]
    
    for command, num in C:
        if command == "insert":
            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 h1(self, key):
        return key % self.length

    def h2(self, key):
        return 1 + (key % (self.length - 1))

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

    def insert(self, key):
        i = 0
        while True:
            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:
            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))

if __name__ == '__main__':

    n = int(eval(input()))
    T = HashTable(n*10)
    C = [input().split(" ") for i in range(n)]
    C = [(x[0], getNum(x[1])) for x in C]
    
    for command, num in C:
        if command == "insert":
            T.insert(num)
        else:
            if T.search(num) is None:
                print("no")
            else:
                print("yes")
# Original solution
# -*- coding: utf-8 -*-

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

    def h1(self, key):
        return key % self.length

    def h2(self, key):
        return 1 + (key % (self.length - 1))

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

    def insert(self, key):
        i = 0
        while True:
            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:
            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)]
    #C = map(lambda x:(x[0], getNum(x[1])), C)
    
    for command, char in C:
        num = getNum(char)
        if command == "insert":
            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 h1(self, key):
        return key % self.length

    def h2(self, key):
        return 1 + (key % (self.length - 1))

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

    def insert(self, key):
        i = 0
        while True:
            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:
            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
# -*- coding: utf-8 -*-

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

    def h1(self, key):
        return key % self.length

    def h2(self, key):
        return 1 + (key % (self.length - 1))

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

    def insert(self, key):
        i = 0
        while True:
            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:
            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:
            #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")