f :: String -> Bool
f [] = True
f str =
	if length str < 5
	then False
	else (g 5 "maerd" str) || (g 5 "esare" str) || (g 6 "resare" str) || (g 7 "remaerd" str)

g :: Int -> String -> String -> Bool
g n kwd str = (take n str == kwd) && (f (drop n str))

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