main :: IO()
main = do
    str <- getLine
    putStrLn $ if getsolve str then "YES" else "NO"

getsolve [] = True
getsolve str
    | len < 5					= False
    | last5 == "dream"			= getsolve $ take (len - 5) str
    | last5 == "erase"			= getsolve $ take (len - 5) str
    | len < 6					= False
    | tail last7 == "eraser"	= getsolve $ take (len - 6) str
    | len < 7					= False
    | last7 == "dreamer"		= getsolve $ take (len - 7) str
    | otherwise					= False
    where len   = length str
          last5 = drop (len - 5) str
          last7 = drop (len - 7) str









