{-# LANGUAGE OverloadedStrings #-}
import qualified Data.ByteString.Char8 as B

main :: IO ()
main = do
    input <- B.getLine
    B.putStrLn $ solve input

solve :: B.ByteString -> B.ByteString
solve goal
    | "dreamer" `B.isPrefixOf` goal = solve (B.drop 7 goal)
    | "eraser"  `B.isPrefixOf` goal = solve (B.drop 6 goal)
    | "dream"   `B.isPrefixOf` goal = solve (B.drop 5 goal)
    | "erase"   `B.isPrefixOf` goal = solve (B.drop 5 goal)
    | B.null goal                  = "YES"
    | otherwise                    = "NO"
