{-# LANGUAGE OverloadedStrings #-}

import qualified Data.Set        as Set
import qualified Data.ByteString as BS
-- import qualified Data.ByteString.Char8 as B8
import Control.Applicative
import Control.Monad

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

dictionary :: [[BS.ByteString]] -> [String]
dictionary cmds = reverse $ snd $ foldl f (Set.empty, []) cmds
  where
    f (dic, ans) [c, s]
      | c == "insert" = (Set.insert s dic, ans)
      | c == "find"   = (dic, (if Set.member s dic then "yes" else "no") : ans)

main :: IO ()
main = do
  n  <- readLn
  xs <- map splitSpace <$> replicateM n BS.getLine
  mapM_ putStrLn $ dictionary xs

