{-# LANGUAGE OverloadedStrings #-}

import qualified Data.ByteString as BS
import Control.Applicative

main :: IO ()
main = do
  n <- readLn
  loop n []

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

loop 0 _ = return ()
loop n dic = do
  [c, s] <- splitSpace <$> BS.getLine
  if c == "insert"
    then loop (n - 1) (s : dic)
    else do
    putStrLn (if elem s dic then "yes" else "no")
    loop (n - 1) dic

