import Data.List
import Data.Bool
import Debug.Trace

main = putStrLn . bool "NO" "YES" . solve =<< getLine

solve "" = True
solve s
    | "dream"   `isSuffixOf` s = solve $ take (length s - length "dream") s
    | "dreamer" `isSuffixOf` s = solve $ take (length s - length "dreamer") s
    | "erase"   `isSuffixOf` s = solve $ take (length s - length "erase") s
    | "eraser"  `isSuffixOf` s = solve $ take (length s - length "eraser") s
    | otherwise = False
