import Control.Applicative
import Control.Monad
import Control.Monad.State
data Tree a = Node a (Tree a) (Tree a) | Nil
singleton x = Node x Nil Nil
type Dict a = Tree a

main = do
  n <- readLn
  let dict = Nil
  exec n dict

exec n d = evalStateT ( replicateM_ n $ do
                      [a,b] <- liftIO $ words<$>getLine
                      let command = toComm a b
                      command) d
toComm "insert" x = insert x
toComm "find" x   = find x

set :: Ord a => a -> Tree a -> Tree a
set x Nil = singleton x
set x (Node a l r)
  | x <= a = Node a (set x l) r
  | x >  a = Node a l (set x r)

look :: Ord a => a -> Tree a -> Bool
look x Nil = False
look x (Node a l r)
  | x == a = True
  | x <  a = look x l
  | x >  a = look x r

insert :: Ord a => a -> StateT (Dict a) IO ()
insert x = modify (set x)

find :: Ord a => a -> StateT (Dict a) IO ()
find x = do
  ds <- get
  let res = look x ds
  if res then liftIO $ putStrLn "yes"
         else liftIO $ putStrLn "no"