import scala.io.{ StdIn => in}

object Main extends App {
  val s = StringBuilder.newBuilder
  s.append(in.readLine)

  val res = s.reverse.toString
    .replaceAll("eraser".reverse,"")
    .replaceAll("erase".reverse,"")
    .replaceAll("dreamer".reverse,"")
    .replaceAll("dream".reverse,"")

  val ans = if(res.isEmpty) "YES" else "NO"
  println(ans)
}