import Control.Monad
import Control.Applicative

insert :: String -> [String] -> [String]
insert k xs = k : xs


solver' :: [String] -> [String] -> IO()
solver' _ [] = return ()
solver' keys (x:xs) =
  let (op:key:_) = words x
  in
      if op == "insert"
        then solver' (insert key keys) xs
        else do
          if key `elem` keys
            then putStrLn "yes"
            else putStrLn "no"
          solver' keys xs



main :: IO()
main = do
  n <- (read :: String -> Int) <$> getLine
  line <- replicateM n getLine
  solver' [] line
  return ()