CodeEff/ECCO huggingface dataset:
# Original solution
dic = {"A":[], "C":[], "G":[], "T":[]}

for i in range(int(eval(input()))):
  cmd, arg = input().split()
  if cmd == "insert":
    dic[arg[0]].append(arg)
  else:
    if arg in dic[arg[0]]:
      print("yes")
    else:
      print("no")

# Optimized solution
dic = {}

for i in range(int(eval(input()))):
  cmd, arg = input().split()
  if cmd == "insert":
    dic[arg] = 0
  else:
    if arg in dic:
      print("yes")
    else:
      print("no")
# Original solution
#! python3
# dictionary.py

# ハッシュ法, チェイン法, 開番地法, etc
# オープンアドレス法で実装する

M = 113131

def getkey(text):
    dic = {'A': 1, 'T': 2, 'G': 3, 'C': 4}
    sum = 0
    p = 1
    for c in text:
        sum += p*dic[c]
        p *= 5
    return sum

def h1(key):
    return key % M

def h2(key):
    return 1 + (key %(M-1))

def h3(key, i):
    return (h1(key) + i*h2(key)) % M

dict = {}
def find(text):
    global dict
    key = getkey(text)
    i = 0
    while i < M:
        h = h3(key, i)
        if dict.get(h) == None:
            break
        elif dict[h] == text:
            return True
        i += 1
    return False

def insert(text):
    global dict
    key = getkey(text)
    i = 0
    while i < M:
        j = h3(key, i)
        if dict.get(j) == None:
            dict[j] = text
            break
        else:
            i += 1

n = int(eval(input()))
for i in range(n):
    op, text = input().split(' ')
    if op == 'insert':
        insert(text)
    elif op == 'find':
        rst = find(text)
        if rst:
            print('yes')
        else:
            print('no')


# Optimized solution
#! python3
# dictionary.py

# ハッシュ法, チェイン法, 開番地法, etc
# オープンアドレス法で実装する

M = 8193173

def getkey(text):
    dic = {'A': 1, 'T': 2, 'G': 3, 'C': 4}
    sum = 0
    p = 1
    for c in text:
        sum += p*dic[c]
        p *= 5
    return sum

def h1(key):
    return key % M

def h2(key):
    return 1 + (key %(M-1))

def h3(key, i):
    return (h1(key) + i*h2(key)) % M

dict = {}
def find(text):
    global dict
    key = getkey(text)
    i = 0
    while i < M:
        h = h3(key, i)
        if dict.get(h) == None:
            break
        elif dict[h] == text:
            return True
        i += 1
    return False

def insert(text):
    global dict
    key = getkey(text)
    i = 0
    while i < M:
        j = h3(key, i)
        if dict.get(j) == None:
            dict[j] = text
            break
        else:
            i += 1

n = int(eval(input()))
for i in range(n):
    op, text = input().split(' ')
    if op == 'insert':
        insert(text)
    elif op == 'find':
        rst = find(text)
        if rst:
            print('yes')
        else:
            print('no')
# Original solution
#! python3
# dictionary.py

# ハッシュ法, チェイン法, 開番地法, etc
# オープンアドレス法で実装する

M = 8193173

def getkey(text):
    dic = {'A': 1, 'T': 2, 'G': 3, 'C': 4}
    sum = 0
    p = 1
    for c in text:
        sum += p*dic[c]
        p *= 5
    return sum

def h1(key):
    return key % M

def h2(key):
    return 1 + (key %(M-1))

def h3(key, i):
    return (h1(key) + i*h2(key)) % M

dict = {}
def find(text):
    global dict
    key = getkey(text)
    i = 0
    while i < M:
        h = h3(key, i)
        if dict.get(h) == None:
            break
        elif dict[h] == text:
            return True
        i += 1
    return False

def insert(text):
    global dict
    key = getkey(text)
    i = 0
    while i < M:
        j = h3(key, i)
        if dict.get(j) == None:
            dict[j] = text
            break
        else:
            i += 1

n = int(eval(input()))
for i in range(n):
    op, text = input().split(' ')
    if op == 'insert':
        insert(text)
    elif op == 'find':
        rst = find(text)
        if rst:
            print('yes')
        else:
            print('no')


# Optimized solution
M = 15140366

def getkey(text):
    dic = {'A': 1, 'T': 2, 'G': 3, 'C': 4}
    sum = 0
    p = 1
    for c in text:
        sum += p*dic[c]
        p *= 5
    return sum

def h1(key):
    return key % M

def h2(key):
    return 1 + (key %(M-1))

def h3(key, i):
    return (h1(key) + i*h2(key)) % M

dict = {}
def find(text):
    global dict
    key = getkey(text)
    i = 0
    while i < M:
        h = h3(key, i)
        if dict.get(h) == None:
            break
        elif dict[h] == text:
            return True
        i += 1
    return False

def insert(text):
    global dict
    key = getkey(text)
    i = 0
    while i < M:
        j = h3(key, i)
        if dict.get(j) == None:
            dict[j] = text
            break
        else:
            i += 1

n = int(eval(input()))
for i in range(n):
    op, text = input().split(' ')
    if op == 'insert':
        insert(text)
    elif op == 'find':
        rst = find(text)
        if rst:
            print('yes')
        else:
            print('no')
# Original solution
import hashlib
M = 15140366

def getkey(text):
    dic = {'A': 1, 'T': 2, 'G': 3, 'C': 4}
    sum = 0
    p = 1
    for c in text:
        sum += p*dic[c]
        p *= 5
    return sum

dict = {}
def find(text):
    global dict
    # key = getkey(text)
    i = 0
    while i < M:
        h = hashlib.md5(text.encode()).hexdigest()
        if dict.get(h) == None:
            break
        elif dict[h] == text:
            return True
        i += 1
    return False

def insert(text):
    global dict
    # key = getkey(text)
    i = 0
    while i < M:
        j = hashlib.md5(text.encode()).hexdigest()
        if dict.get(j) == None:
            dict[j] = text
            break
        else:
            i += 1

n = int(eval(input()))
for i in range(n):
    op, text = input().split(' ')
    if op == 'insert':
        insert(text)
    elif op == 'find':
        rst = find(text)
        if rst:
            print('yes')
        else:
            print('no')



# Optimized solution
M = 15140366
def h1(key):
    return key % M

def h2(key):
    return 1 + (key %(M-1))

def h3(key, i):
    return (h1(key) + i*h2(key)) % M

word_dic = {'A': 1, 'T': 2, 'G': 3, 'C': 4}
def getkey(text):
    sum = 0
    p = 1
    for c in text:
        sum += p*word_dic[c]
        p *= 5
    return sum

dict = {}
def find(text):
    global dict
    key = getkey(text)
    i = 0
    while i < M:
        h = h3(key, i)
        if dict.get(h) == None:
            break
        elif dict[h] == text:
            return True
        i += 1
    return False

def insert(text):
    global dict
    key = getkey(text)
    i = 0
    while i < M:
        j = h3(key, i)
        if dict.get(j) == None:
            dict[j] = text
            break
        else:
            i += 1

n = int(eval(input()))
for i in range(n):
    op, text = input().split(' ')
    if op == 'insert':
        insert(text)
    elif op == 'find':
        rst = find(text)
        if rst:
            print('yes')
        else:
            print('no')
# Original solution
M = 15140366
def h1(key):
    return key % M

def h2(key):
    return 1 + (key %(M-1))

def h3(key, i):
    return (h1(key) + i*h2(key)) % M

word_dic = {'A': 1, 'T': 2, 'G': 3, 'C': 4}
def getkey(text):
    sum = 0
    p = 1
    for c in text:
        sum += p*word_dic[c]
        p *= 5
    return sum

dict = {}
def find(text):
    global dict
    key = getkey(text)
    i = 0
    while i < M:
        h = h3(key, i)
        if dict.get(h) == None:
            break
        elif dict[h] == text:
            return True
        i += 1
    return False

def insert(text):
    global dict
    key = getkey(text)
    i = 0
    while i < M:
        j = h3(key, i)
        if dict.get(j) == None:
            dict[j] = text
            break
        else:
            i += 1

n = int(eval(input()))
for i in range(n):
    op, text = input().split(' ')
    if op == 'insert':
        insert(text)
    elif op == 'find':
        rst = find(text)
        if rst:
            print('yes')
        else:
            print('no')



# Optimized solution
M = 2056197
def h1(key):
    return key % M

def h2(key):
    return 1 + (key %(M-1))

def h3(key, i):
    return (h1(key) + i*h2(key)) % M

word_dic = {'A': 1, 'T': 2, 'G': 3, 'C': 4}
def getkey(text):
    sum = 0
    p = 1
    for c in text:
        sum += p*word_dic[c]
        p *= 5
    return sum

dict = {}
def find(text):
    global dict
    key = getkey(text)
    i = 0
    while i < M:
        h = h3(key, i)
        if dict.get(h) == None:
            break
        elif dict[h] == text:
            return True
        i += 1
    return False

def insert(text):
    global dict
    key = getkey(text)
    i = 0
    while i < M:
        j = h3(key, i)
        if dict.get(j) == None:
            dict[j] = text
            break
        else:
            i += 1

n = int(eval(input()))
for i in range(n):
    op, text = input().split(' ')
    if op == 'insert':
        insert(text)
    elif op == 'find':
        rst = find(text)
        if rst:
            print('yes')
        else:
            print('no')
# Original solution
M = 1046527
def h1(key):
    return key % M

def h2(key):
    return 1 + (key %(M-1))

def h3(key, i):
    return (h1(key) + i*h2(key)) % M

word_dic = {'A': 1, 'T': 2, 'G': 3, 'C': 4}
def getkey(text):
    sum = 0
    p = 1
    for c in text:
        sum += p*word_dic[c]
        p *= 5
    return sum

dict = {}
def find(text):
    global dict
    key = getkey(text)
    i = 0
    while i < M:
        h = h3(key, i)
        if dict.get(h) == None:
            break
        elif dict[h] == text:
            return True
        i += 1
    return False

def insert(text):
    global dict
    key = getkey(text)
    i = 0
    while i < M:
        j = h3(key, i)
        if dict.get(j) == None:
            dict[j] = text
            break
        else:
            i += 1

n = int(eval(input()))
for i in range(n):
    op, text = input().split(' ')
    if op == 'insert':
        insert(text)
    elif op == 'find':
        rst = find(text)
        if rst:
            print('yes')
        else:
            print('no')


# Optimized solution
import sys

M = 1046527
def h1(key):
    return key % M

def h2(key):
    return 1 + (key %(M-1))

def h3(key, i):
    return (h1(key) + i*h2(key)) % M

word_dic = {'A': 1, 'T': 2, 'G': 3, 'C': 4}
def getkey(text):
    sum = 0
    p = 1
    for c in text:
        sum += p*word_dic[c]
        p *= 5
    return sum

dict = {}
def find(text):
    global dict
    key = getkey(text)
    i = 0
    while i < M:
        h = h3(key, i)
        if dict.get(h) == None:
            break
        elif dict[h] == text:
            return True
        i += 1
    return False

def insert(text):
    global dict
    key = getkey(text)
    i = 0
    while i < M:
        j = h3(key, i)
        if dict.get(j) == None:
            dict[j] = text
            break
        else:
            i += 1

n = int(eval(input()))
operations = sys.stdin.readlines()
for ope in operations:
    op, text = ope.rstrip().split(' ')
    if op == 'insert':
        insert(text)
    elif op == 'find':
        rst = find(text)
        if rst:
            print('yes')
        else:
            print('no')
# Original solution
from collections import deque

n = int(eval(input()))
dict = deque()
for i in range(n):
    order = input().split()
    if order[0] == "insert":
        dict.append(order[1])
    else:
        if order[1] in dict:
            print("yes")
        else:
            print("no")

# Optimized solution
from collections import deque

n = int(eval(input()))
dict = {}
for i in range(n):
    order = input().split()
    if order[0] == "insert":
        dict[order[1]] = i
    else:
        if order[1] in dict:
            print("yes")
        else:
            print("no")
# Original solution
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
#start = time.clock()
#i = 0
a,b=[],[]
check = re.compile('insert')
n=eval(input())
#while True:
for x in range(n):
    (i,f)=list(map(str, input().split()))
    if check.search(i):
        a.append(f)
    else:
#        b.append(f)
#print a
#print b
#for y in b:
        if f in a:
            print('yes')
        else:
            print('no')

# Optimized solution
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
#start = time.clock()
#i = 0
#check = 'insert'
n=eval(input())
a=set()
for x in range(n):
    (i,f)=list(map(str, input().split()))
    if i=='insert':
        a.add(f)
    else:
        if f in a:
            print('yes')
        else:
            print('no')
# Original solution
import sys
d={}
for e in sys.stdin.readlines()[1:]:
 c,g=e.split()
 if'i'==c[0]:d[g]=0
 else:print((['no','yes'][g in d]))


# Optimized solution
import sys
d={}
for e in sys.stdin.readlines()[1:]:
 if'i'==e[0]:d[e[7:]]=0
 else:print((['no','yes'][e[5:]in d]))
# Original solution
import sys
d={}
for e in sys.stdin.readlines()[1:]:
 if'f'==e[0]:print(('yes'if e[5:]in d else'no'))
 else:d[e[7:]]=0


# Optimized solution
import sys
def m():
 d={}
 for e in sys.stdin.readlines()[1:]:
  if'f'==e[0]:print(('yes'if e[5:]in d else'no'))
  else:d[e[7:]]=0
if'__main__'==__name__:m()
# Original solution
import sys
def m():
 d={}
 for e in sys.stdin.readlines()[1:]:
  if'f'==e[0]:print(('yes'if e[5:]in d else'no'))
  else:d[e[7:]]=0
if'__main__'==__name__:m()


# Optimized solution
import sys
def m():
 d={};eval(input())
 for e in sys.stdin:
  if'f'==e[0]:print(('yes'if e[5:]in d else'no'))
  else:d[e[7:]]=0
if'__main__'==__name__:m()
# Original solution
import sys
def m():
 d={};eval(input())
 for e in sys.stdin:
  if'f'==e[0]:print(('yes'if e[5:]in d else'no'))
  else:d[e[7:]]=0
if'__main__'==__name__:m()


# Optimized solution
import sys
def m():
 d={};eval(input())
 for e in sys.stdin:
  if'f'==e[0]:print((['no','yes'][e[5:]in d]))
  else:d[e[7:]]=0
if'__main__'==__name__:m()
# Original solution
import sys
def m():
 d={0};eval(input())
 for e in sys.stdin:
  if'f'==e[0]:print((['no','yes'][e[5:]in d]))
  else:d|={e[7:]}
if'__main__'==__name__:m()


# Optimized solution
import sys
def m():
 d={};eval(input())
 for e in sys.stdin:
  if'f'==e[0]:print((['no','yes'][e[5:]in d]))
  else:d[e[7:]]=0
if'__main__'==__name__:m()
# Original solution
N = int(eval(input()))
d = {}
for i in [None]*N:
    a, b = input().split()
    if a == "insert":
        d[b] = 1
    else:
        print(("yes" if b in d else "no"))

# Optimized solution
class Dictionary(object):
    def __init__(self, size):
        self.size = size
        self.a = [None]*size

    def hash(self, x):
        key = hash(x) % self.size
        while self.a[key] and self.a[key] != x:
            key = (key + 10**9+7) % self.size
        return key

    def insert(self, x):
        self.a[self.hash(x)] = x

    def find(self, x):
        return self.a[self.hash(x)] is not None


if __name__ == "__main__":
    import sys
    n = int(input())
    dictionary = Dictionary(n)
    result = []
    for command, s in (l.split() for l in sys.stdin):
        if command == "insert":
            dictionary.insert(s)
        else:
            result.append("yes" if dictionary.find(s) else "no")

    print(*result, sep="\n")
# Original solution
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 30 13:14:10 2018
ALDS1-4c simple implementation
@author: maezawa
"""

n = int(eval(input()))
a = []
for s in range(n):
    cmd, word = input().split()
    if cmd == 'insert':
        a.append(word)
    else:
        if word in a:
            print('yes')
        else:
            print('no')




# Optimized solution
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 30 13:14:10 2018
ALDS1-4c  implementation with dictionary
@author: maezawa
"""

n = int(eval(input()))
a = dict([])
for s in range(n):
    cmd, word = input().split()
    if cmd == 'insert':
        a[word]=''
    else:
        if word in a:
            print('yes')
        else:
            print('no')
# Original solution
command_num = int(eval(input()))
dict = []

for i in range(command_num):
    in_command, in_str = input().rstrip().split(" ")
    
    if in_command == "insert":
        dict.append(in_str)
    elif in_command == "find":
        if dict.count(in_str) > 0:
            print("yes")
        else:
            print("no")

# Optimized solution
command_num = int(eval(input()))
dict = set([])

for i in range(command_num):
    in_command, in_str = input().rstrip().split(" ")
    
    if in_command == "insert":
        dict.add(in_str)
    elif in_command == "find":
        if in_str in dict:
            print("yes")
        else:
            print("no")
# Original solution
def find(data, s):
    l = 0
    r = len(data)
    while l < r:
        ind = (l + r) // 2
        if data[ind] == s:
            return True
        elif data[ind] < s:
            l = ind + 1
        else:
            r = ind
    return False


def insert(data, s):
    if len(data) == 0:
        data.append(s)
    else:
        for i in range(len(data)):
            if s <= data[i]:
                data.insert(i, s)
                return data
        data.append(s)
    return data


n = int(eval(input()))
data = []
for _ in range(n):
    command = input().split()
    if command[0] == "insert":
        data = insert(data, command[1])
    elif command[0] == "find":
        if find(data, command[1]):
            print("yes")
        else:
            print("no")


# Optimized solution
n = int(eval(input()))
data = set()
for _ in range(n):
    command = input().split()
    if command[0] == "insert":
        data.add(command[1])
    elif command[0] == "find":
        if command[1] in data:
            print("yes")
        else:
            print("no")
# Original solution
class my_dict:

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

    def insert(self, x):
        if (x not in self.d):
            self.d.append(x)

    def find(self, x):
        if (x in self.d):
            return 'yes'
        else:
            return 'no'


def main():
    n = int(eval(input()))
    my_d = my_dict()

    for i in range(n):
        command, string = input().split()
        if (command == 'insert'):
            my_d.insert(string)
        elif (command == 'find'):
            print((my_d.find(string)))


if __name__ == "__main__":
    main()

# Optimized solution
def main():
    n = int(eval(input()))
    d = set([])


    for i in range(n):
        command, string = input().split()
        if (command == 'insert'):
            d.add(string)
        elif (command == 'find'):
            if string in d:
                print('yes')
            else:
                print('no')

if __name__ == "__main__":
    main()
# Original solution
def h1(key):
    return key % m


def h2(key):
    return 1 + key % (m - 1)


def h(key, i):
    return h1(key + i * h2(key)) % m


def insert(T, key):
    i = 0
    while True:
        j = h(key, i)
        if T[j] is None:
            T[j] = key
            return j
        else:
            i += 1


def search(T, key):
    i = 0
    while True:
        j = h(key, i)
        if T[j] == key:
            return j
        elif T[j] is None or i >= m:
            return None
        else:
            i += 1


global m
r = {"A": 1, "C": 2, "G": 3, "T": 4, }
t = []
m = int(eval(input()))
for i in range(m):
    cmd, key = input().split()
    if cmd == "insert":
        t.append(key)
    else:
        if key in t:
            print("yes")
        else:
            print("no")

# Optimized solution
t = set()
m = int(eval(input()))
for i in range(m):
    cmd, key = input().split()
    if cmd == "insert":
        t.add(key)
    else:
        if key in t:
            print("yes")
        else:
            print("no")
# Original solution
import sys
readline = sys.stdin.readline
li = []
for _ in range(int(readline())):
    c, s = readline().split()
    if c == "insert":
        li.append(s)
    elif c == "find":
        print(("yes" if s in li else "no"))



# Optimized solution
import sys
readline = sys.stdin.readline
SET = set()
for _ in range(int(readline())):
    c, s = readline().split()
    if c == "insert":
        SET.add(s)
    elif c == "find":
        print(("yes" if s in SET else "no"))
# Original solution
import sys
readline = sys.stdin.readline
SET = set()
for _ in range(int(readline())):
    c, s = readline().split()
    if c == "insert":
        SET.add(s)
    elif c == "find":
        print(("yes" if s in SET else "no"))



# Optimized solution
import sys
readline = sys.stdin.readline
SET = set()
eval(input())
for s in sys.stdin:
    if s[0] == "i":
        SET.add(s[7:])
    elif s[0] == "f":
        print(("yes" if s[5:] in SET else "no"))
# Original solution
n = int(input())

dict = []
for i in range(n):
    command, word = input().split()
    if command == 'insert':
        dict.append(word)
    else:
        try:
            dict.index(word)
            print('yes')
        except:
            print('no')
            pass
        

# Optimized solution
n = int(input())

def makeHash(letter):
    if letter == 'A':
        return 1
    elif letter == 'C':
        return 2
    elif letter == 'G':
        return 3
    elif letter == 'T':
        return 4
    return 0

dict = {}
for i in range(n):
    command, word = input().split()
    key = 0
    if command == 'insert':
         dict[word] = 1
    elif command == 'find':
        if word in dict: 
            print('yes')
        else:
            print('no')
# Original solution
if __name__ == '__main__':
    try:
        n = int(input())
    except:
        print('the first input must be integer value!')
        exit()

    genoms = []
    answers = []
    for _ in range(n):
        values = input().split()
        order = values[0]
        genom = values[1]
        if order == "insert":
            genoms.append(genom)
        else:
            answers.append('yes' if genom in genoms else 'no' )

    # print(genoms)
    # print(answers)

    for answer in answers:
        print(answer)

# Optimized solution
if __name__ == '__main__':
    try:
        n = int(input())
    except:
        print('the first input must be integer value!')
        exit()

    genoms = set([])
    answers = []
    for _ in range(n):
        values = input().split()
        order = values[0]
        genom = values[1]
        if order == "insert":
            genoms.add(genom)
        else:
            # TODO: fasten here!
            answers.append('yes' if genom in genoms else 'no' )

    # print(genoms)
    # print(answers)

    for answer in answers:
        print(answer)
# Original solution
n = int(eval(input()))
  
s = set()
for i in range(n):
    c, m = input().split()
    if c[0] == 'i':
        s.add(m)
    elif c[0] == 'f':
        if m in s:
            print('yes')
        else:
            print('no')

# Optimized solution
n = int(input())
  
l = []
s = {}
for i in range(n):
    c, m = input().split()
    if c[0] == 'i':
        s[m] = 0
    elif c[0] == 'f':
        if m in s:
            l.append('yes')
        else:
            l.append('no')
print(*l,sep='\n')
# Original solution
from collections import deque
n = int(eval(input()))
l = deque()

for i in range(n):
    cmd = input().split()
    if cmd[0] == 'insert':
        l.append(cmd[1])
    if cmd[0] == 'find':
        if cmd[1] in set(l):
        	print('yes')
        else:
        	print('no')

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

for i in range(n):
    cmd = input().split()
    if cmd[0] == 'insert':
        l.add(cmd[1])
    if cmd[0] == 'find':
        if cmd[1] in l:
        	print('yes')
        else:
        	print('no')