{-# 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) tns where
    tns = [("dreameraser", 11), ("dreamerase", 10), ("dreamer", 7),
           ("dream", 5), ("eraser", 6), ("erase", 5)]

match :: String -> (String, Int) -> Bool
match s (t, n)
    | take n s == t = solve' $ drop n s
    | otherwise     = False where
