import           Control.Applicative
import           Control.Monad

data Tree a
    = Empty
    | Node a (Tree a) (Tree a)
    deriving Show

tinsert :: Ord a => a -> Tree a -> Tree a
tinsert x Empty = Node x Empty Empty
tinsert x n@(Node y l r)
    | x < y = Node y (tinsert x l) r
    | x > y = Node y l (tinsert x r)
    | otherwise = n

tfind :: Ord a => a -> Tree a -> Bool
tfind x Empty = False
tfind x (Node y l r)
    | x < y = tfind x l
    | x > y = tfind x r
    | otherwise = True

solve :: [[String]] -> IO ()
solve xs = go Empty xs
  where
    go _ [] = return ()
    go t ([cs,ds]:ys)
        | head cs == 'i' = go (tinsert ds t) ys
        | head cs == 'f' = do
              if tfind ds t
                 then putStrLn "yes"
                 else putStrLn "no"
              go t ys

main :: IO ()
main = do
    n <- readLn :: IO Int
    xs <- fmap words <$> replicateM n getLine :: IO [[String]]
    solve xs

