import qualified Data.Map.Strict as Map
import Control.Applicative

main :: IO ()
main = do
  n <- readLn
  loop n Map.empty

loop 0 _   = return ()
loop n dic = do
  [c, s] <- words <$> getLine
  case c of
    "insert" -> loop (n - 1) (Map.insert s n dic)
    "find" -> do
      putStrLn (if Map.member s dic then "yes" else "no")
      loop (n - 1) dic

