import qualified Data.Set as Set
import Control.Applicative
import Control.Monad

dictionary :: [[String]] -> [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 words <$> replicateM n getLine
  mapM_ putStrLn $ dictionary xs

