{-# LANGUAGE BangPatterns #-}
import Data.List
import Data.Maybe
import Data.Function (fix)
import Data.Array (Array, array, (!))
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BS8
 
getInts :: IO [Int]
getInts = (map parseInt . BS8.words) <$> BS.getLine 
    where parseInt = fst . fromJust . BS8.readInt

solve :: String -> Int -> String
solve ('d':'r':'e':'a':'m':other) _ = solve other 1
solve ('e':'r':'a':'s':'e':other) _ = solve other 2
solve ('e':'r':'d':'r':'e':'a':'m':other) 1 = solve other 1
solve "er" 1 = "YES"
solve "r" 2 = "YES"
solve [] _ = "YES"
solve _ _ = "NO"

main :: IO ()
main = do
    str <- getLine
    putStrLn $ solve str 0