import Control.Applicative
import Control.Monad
import Control.Monad.State

type Dictionary = StateT [String] IO ()

main = do
        n <- readLn
        execStateT (replicateM n runQuery) []

insert :: String -> Dictionary
insert str = modify (str:)
find :: String -> Dictionary
find str = do
        dict <- get
        if str `elem` dict then liftIO $ putStrLn "yes"
                           else liftIO $ putStrLn "no"

runQuery = do
        com <- liftIO getCommand
        com

getCommand :: IO Dictionary
getCommand = do
        [com,str] <- words<$>getLine
        case com of
            "insert" -> return $ insert str
            "find"   -> return $ find str