wordsparser::String ->Bool
wordsparser [] = True
wordsparser cs
      | take 5 cs == "maerd" = wordsparser (drop 5 cs)
      | take 5 cs == "esare" = wordsparser (drop 5 cs)
      | take 6 cs == "resare" = wordsparser (drop 6 cs)
      | take 7 cs == "remaerd" = wordsparser (drop 7 cs)
      | otherwise = False

main::IO()
main =do
  dat<-getLine
  putStr ((if wordsparser (reverse) dat then "YES" else "NO")++"\n")
