{-# LANGUAGE OverloadedStrings #-}

import qualified Data.ByteString as BS
import qualified Data.Map.Strict as Map
import Control.Applicative
import Control.Monad


main :: IO ()
main = do
  n <- readLn
  xs <- map splitSpace <$> replicateM n BS.getLine
  mapM_ putStrLn $ reverse $ snd $ foldl f (Map.empty, []) xs
    where
      f (dic, prd) [c, s]
        | c == "insert" = (Map.insert s 1 dic, prd)
        | c == "find"   = (dic, yn : prd)
        where yn = if Map.member s dic then "yes" else "no"

splitSpace :: BS.ByteString -> [BS.ByteString]
splitSpace = BS.split 32

