main = do
    s_ <- getLine
    let parse [] = "YES"
	parse str = case splitAt 5 str of
	    ("dream",rem)	-> case rem of
				    'e':'r':'a':_   -> parse rem
				    'e':'r':rem'    -> parse rem'
				    otherwise	    -> parse rem
	    ("erase",rem)	-> case rem of
				    'r':rem'	-> parse rem'
				    otherwise	-> parse rem
	    otherwise	-> "NO"
    putStr$parse s_