object Main extends App {
  import scala.util.parsing.combinator._

  val s = scala.io.StdIn.readLine
  println(if (S(s.reverse)) "YES" else "NO")

  object S extends S {
    def apply(t: String) = parseAll(s, t) match {
      case Success(res, in) => true
      case _ => false
    }
  }
  class S private extends RegexParsers {
    def s = "(maerd|remaerd|esare|resare)+".r
  }
}