main = do
  s <- getLine
  if possible s then putStrLn "YES" else putStrLn "NO"

possible [] = True
possible s = dream s || dreamer s || erase s || eraser s

dream ('d':'r':'e':'a':'m':s) = possible s
dream _ = False
dreamer ('d':'r':'e':'a':'m':'e':'r':s) = possible s
dreamer _ = False
erase ('e':'r':'a':'s':'e':s) = possible s
erase _ = False
eraser ('e':'r':'a':'s':'e':'r':s) = possible s
eraser _ = False