import Control.Monad
import Control.Applicative

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

find :: String -> [String] -> String
find k xs =
  if k `elem` xs
    then "yes"
    else "no"


solver :: [String] -> [String] -> [String]
solver _ [] = []
solver keys (x:xs) =
  let (op:key:_) = words x
  in
      if op == "insert"
        then solver (insert key keys) xs
        else find key keys : solver keys xs


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