### 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
import random

class Node:
    """ Treap???????´?????????? """

    def __init__(self, value, usen):
        """ ????????????????????? """
        self.V = value # ???
        self.U = usen # ?????????
        self.L = None # ??????
        self.R = None # ??????

def Find(t, value):
    """ ????????¨??¢?´¢ """
    
    if t is not None:
        if value == t.V: # ?????????
#            print("Finded p:'{}' v:'{}'".format(t.V, value))
            return True

        elif value < t.V: # ?°????????????§??????
#            print("Left Search p:'{}' v:'{}'".format(t.V, value))
            return Find(t.L, value)

        elif value > t.V: # ??§???????????§??????
#            print("Right Search p:'{}' v:'{}'".format(t.V, value))
            return Find(t.R, value)

#    print("Not Exists v:'{}'".format(value))
    return False

def Insert(t, value):
    """ ????????¨???????????? """

    if t is None: # ???????????????
        t = Node(value, random.random())
#        print("\tInsert '{}'".format(value))
        return t # ????´??????\

    if value < t.V: # ?°???????
#        print("\tto Left p:'{}' v:'{}'".format(t.V, value))
        t.L = Insert(t.L, value) # ??????????´??????\
        if t.U > t.L.U:
            return RotateR(t)

    elif value > t.V: # ??§??????
#        print("\tto Right p:'{}' v:'{}'".format(t.V, value))
        t.R = Insert(t.R, value) # ?????????
        if t.U > t.R.U:
            return RotateL(t)

#    elif value == t.V: # ???????????????????????????????????§??????
#        print("\tExists p:'{}' v:'{}'".format(t.V, value))

    return t

def RotateR(a):
    """ ????????¨???????????¢ a:??? b:??°????????? """
    if a.L is None: # ??????????????????
        return a
    b = a.L     # b ??? a ?????????
    a.L = b.R   # a ???????????? b ??????????????????
    b.R = a     # b ???????????? a ?????????
#    print("\t\tRotateR a:{} b:{} b.R.V:{}".format(a.V, b.V, b.R.V))
    return b

def RotateL(a):
    """ ????????¨???????????¢ a:??? b:??°????????? """

    if a.R is None: # ??????????????????
        return a
    b = a.R     # b ??? a ?????????
    a.R = b.L   # a ???????????? b ??????????????????
    b.L = a     # b ???????????? a ?????????
#    print("\t\tRotateL a:{} b:{} b.L.V:{}".format(a.V, b.V, b.L.V))
    return b

def GetList(t, a):
    if t is not None:
        a.append(t.V)
        GetList(t.L, a)
        GetList(t.R, a)

def main():
    """ ????????? """
    random.seed() # ??±??°?????????
    num = int(input().strip())
    istr = sys.stdin.read()
    cmds = list(istr.splitlines())
    root = None
    
    for i in cmds:
#        print("cmd:{} tree:{}".format(i,root))
        if i[0] == "i":
            root = Insert(root, i[7:])
        elif i[0] == "f":
            ret = Find(root, i[5:])
            if ret == True:
                print("yes")
            else:
                print("no")
#        a = []
#        GetList(root,a)
#        print(a)

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()