import java.util.Scanner

import scala.annotation.tailrec

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val s = sc.nextLine()
    val ans = if (""==s.replaceAll("dream","").replaceAll("dreamer","").replaceAll("erase","").replaceAll("eraser","")) "YES"else "NO"
    println(ans)
  }
}
