import java.util.Scanner

import scala.util.control.Breaks

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

  val b = new Breaks

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

}
