import scala.util.control.Breaks

object Main{
  def main(args: Array[String]) {
    val sc = new java.util.Scanner(System.in)
    var s = sc.next

    val b = new Breaks
    b.breakable { while (s.size > 0) {
      if (s.size < 5)
        b.break
      val substr = s.take(5)
      if (substr == "erase" || substr == "dream") {
        s = s.drop(5)
        if (s.size >0 && s.head == 'r')
          s = s.drop(1)
      }
    } }
    if (s.size == 0)
      println("YES")
    else
      println("NO")
  }
}
