import java.util.Scanner

import scala.util.control.Breaks

object Main extends App {
  val sc = new Scanner(System.in)
  val n = sc.nextLine()

  val b = new Breaks
  b.breakable {
    for (seq <- Seq("dreamer", "eraser", "dream", "erase").permutations) {
      n.replace(seq(0), "").replace(seq(1), "").replace(seq(2), "").replace(seq(3), "").length match {
        case 0 => {
          println("YES")
          b.break()
        }
        case _ =>
      }
    }
    println("NO")
  }

}
