### BUGGY CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
??\????????????????????????????°?????????????????????????????£??????????????????????

insert str: ????????? str ??????????????????
find str: ????????? str ?????????????????´??? 'yes'??¨????????????????????´??? 'no'??¨???????????????

??????????????????????????????'A', 'C', 'G', 'T' ???????¨????????????????????§????????????????
1 ??? ?????????????????? ??? 12  n ??? 1,000,000

"""
import sys

# ????´??????¢?????¬????????????
NoVal = -1

# ????????¨????????????
Black = 0
Red = 1

class Node:
    """ ???????????? """

    def __init__(self, pnode, color, value):
        """ ????????????????????? """
        self.P = pnode # ????????????
        self.V = value # ???
        self.C = color # ???
        self.L = NoVal # ??????
        self.R = NoVal # ??????

def Find(r,value):
    """ ????????¨??¢?´¢ """
    
    if isinstance(r, Node) == False:
        return False
    if value == r.V:
#        print("Finded p:'{}' v:'{}'".format(r.V, value))
        return True
    if value < r.V: # ?°????????????§??????
        if isinstance(r.L, Node) == True:
#            print("Left Search p:'{}' v:'{}'".format(r.V, value))
            return Find(r.L, value)
    elif value > r.V: # ??§???????????§??????
        if isinstance(r.R, Node) == True:
#            print("Right Search p:'{}' v:'{}'".format(r.V, value))
            return Find(r.R, value)
#    print("Not Exists r:{} v:'{}'".format(r.V, value))
    return False

def Insert(r, value):
    """ ????????¨???????????? """
    if isinstance(r, Node) == False: # ???????????????
#        print("Root Insert '{}'".format(value))
        return Node(NoVal, Black, value) # ????´??????\

    if value == r.V: # ???????????????????????????????????§??????
#        print("Exists p:'{}' v:'{}'".format(r.V, value))
        return NoVal

    if value < r.V: # ?°???????
        if isinstance(r.L, Node) == False: # ??????????????????
            r.L = Node(r, Red, value) # ??????????´??????\
#            print("Left Insert '{}'".format(value))
            return r.L
        else:
#            print("Next Left p'{}' v'{}'".format(r.V, value))
            Insert(r.L, value) # ?????????
    elif value > r.V: # ??§??????
        if isinstance(r.R, Node) == False: # ??????????????????
#            print("Right Insert '{}'".format(value))
            r.R = Node(r, Red, value) # ??????????´??????\
            return r.R
        else:
#            print("Next Right p:'{}' v:'{}'".format(r.V, value))
            Insert(r.R, value) # ?????????

def RotateR(a):
    """ ????????¨???????????¢ a:????????? ?????????:??°????????? """
    b = a.L     # a ???????????? b ??¨??????
    b.P = a.P   # b ????????? a ???????????????
    a.P = b     # a ????????? b ?????????
    a.L = b.R   # a ???????????? b ??????????????????
    a.L.P = a   # a ?????????????????? a ?????????
    b.R = a     # b ???????????? a ?????????
    if b.P != NoVal: # b ??????????´????????????????
       if b.P.L == a: # b ?????????????????? a ??????
            b.P.L = b    # b ?????????????????? b ?????????
       elif b.P.R == a: # b ?????????????????? a ??????
            b.P.R = b    # b ?????????????????? b ?????????
    return b

def RotateL(a):
    """ ????????¨???????????¢ r:????????? """
    b = a.R     # a ???????????? b ??¨??????
    b.P = a.P   # b ????????? a ???????????????
    a.P = b     # a ????????? b ?????????
    a.R = b.L   # a ???????????? b ??????????????????
    a.R.P = a   # a ?????????????????? a ?????????
    b.L = a     # b ???????????? a ?????????
    if b.P != NoVal: # b ??????????´????????????????
       if b.P.L == a: # b ?????????????????? a ??????
            b.P.L = b    # b ?????????????????? b ?????????
       elif b.P.R == a: # b ?????????????????? a ??????
            b.P.R = b    # b ?????????????????? b ?????????
    return b

def Restruct(r):
    """ ????§???? """
    
    if isinstance(r, Node) == False: # ?????§??????
        return
    
    if r.C == Black: # ???????????????????????????????????????
        return

    p = r.P
    if p == NoVal: # ???????????????
        r.C = Black # ???????????????????????????
        return

    if p.C == Red: # ????????????
        if p.P.L == p: # ????????????
            if p.L == r: # ???????????????
                p = RotateR(p) # LL:????????¢
            else: # ???????????????
                RotateL(r) # LR: 1.????????¢
                p = RotateR(p) # LR: 2.????????¢
        else: # ????????????
            if r.P.L == r: # ???????????????
                RotateR(r) # RL: 1.????????¢
                p = RotateL(p) # RL: 2.????????¢
            else: # ???????????????
                p = RotateL(p) ## LR: ????????¢
        if p.C == Red: # ??°???????????????????????°???????????????????§????
            Restruct(p)

def main():
    """ ????????? """
    num = int(input().strip())
    istr = sys.stdin.read()
    cmds = list(istr.splitlines())
    root = NoVal
    
    for i in cmds:
        if i[0] == "i":
            r = Insert(root, i[7:])
            if isinstance(root, Node) == False:
                root = r
        elif i[0] == "f":
            ret = Find(root, i[5:])
            if ret == True:
                print("yes")
            else:
                print("no")

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys

def main():
    """ MAIN """
    num = int(input().strip())
    istr = sys.stdin.read()
    cmds = list(istr.splitlines())

    D = {}
    for i in cmds:
        if i[0] == "i":
            D[i[7:]] = 1
        elif i[0] == "f":
            if i[5:] in D:
                print("yes")
            else:
                print("no")

if __name__ == '__main__':
    main()