import java.util.*

fun main(args: Array<String>) {
    Scanner(System.`in`).use { sc ->
        println(if (Regex("""(?:dream(?:er)?|eraser?)*""").matchEntire(sc.next()) != null) "YES" else "NO")
    }
}