{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}

main :: IO ()
main = putStrLn =<< solve <$> getLine


solve :: String -> String
solve s
    | solve' s  = "YES"
    | otherwise = "NO"

solve' :: String -> Bool
solve' "" = True
solve' s = any (match s) ts where
    ts = ["dreameraser", "dreamerase", "dreamer",
          "dream", "eraser", "erase"]

match :: String -> String -> Bool
match s t
    | take n s == t = solve' $ drop n s
    | otherwise     = False where
          n = length t
