import java.util.Scanner

import scala.annotation.tailrec

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

  @tailrec
  def solve(s: String) : String = {
    s match {
      case "" => "YES"
      case _ if s startsWith "dreameraser" => solve(s.drop(11))
      case _ if s startsWith "dreamerase"  => solve(s.drop(10))
      case _ if s startsWith "dreamer"     => solve(s.drop(7))
      case _ if s startsWith "dream"       => solve(s.drop(5))
      case _ if s startsWith "eraser"      => solve(s.drop(6))
      case _ if s startsWith "erase"       => solve(s.drop(5))
      case _ => "NO"
    }
  }

  println(solve(s))
}
