import Data.List
import Control.Monad

data YesNo = Yes | No deriving(Show)

subseq :: [String]
subseq = ["dream", "dreamer", "erase", "eraser"]

solver :: String  -> YesNo
solver [] = Yes
solver s
    | s `elem` subseq = Yes
    | otherwise       =
        let cans = filter (\x -> x `isSuffixOf` s) subseq
            lcan = (length . head) cans
            len  = length s
        in if null cans then No else solver (take (len - lcan) s)

main :: IO ()
main = getLine >>= (print . solver)
