import Control.Applicative
import Control.Monad
import Data.IORef
import Data.Map as M
type Dict a = M.Map a ()

main = do
  n <- readLn
  dict <- newIORef (M.empty)
  exec n dict

exec n d = replicateM_ n $ do
  [a,b] <- words<$>getLine
  let command = toComm a b
  command d
toComm :: Ord a => String -> a -> (IORef (Dict a) -> IO ())
toComm "insert" x = Main.insert x
toComm "find" x   = find x

insert :: Ord a => a -> IORef (Dict a) -> IO ()
insert x d = modifyIORef d (M.insert x ())

find :: Ord a => a -> IORef (Dict a) -> IO ()
find x d = do
  ds <- readIORef d
  let res = M.lookup x ds
  if res == Nothing then putStrLn "no"
                    else putStrLn "yes"