import java.util.Scanner

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

  s = s.replace("dreameraser","").
    replace("dreamer","").replace("eraser","").
    replace("dream","").replace("erase","")
  if (s.length == 0) {
    println("YES")
  } else {
    println("NO")
  }
}
