

import Data.List


splittable :: String -> Bool

splittable "" = True

splittable l = if "eraser" `isPrefixOf` l
                  then splittable (drop 6 l)
                  else if "erase" `isPrefixOf` l
                    then splittable (drop 5 l)
                    else if "dreamer" `isPrefixOf` l && (length l <= 7 || (l!!7) /= 'a')
                        then splittable (drop 7 l)
                        else if "dream" `isPrefixOf` l
                            then splittable (drop 5 l)
                            else False




main = do
    l <- getLine
    let result = if (splittable l) then "YES" else "NO"
    putStrLn result
