// dream, dreamer, erase, eraser
fun main(args: Array<String>) {
    val value = readLine() ?: return
    val reversedValue = value.reversed()
    var current = reversedValue
    while (true) {
        val str = extractTargetStr(current)
        if (str.isEmpty()) {
            println("YES")
            return
        }
        if (str.length == current.length) {
            println("NO")
            return
        }
        current = str
    }
}

// return next start position
private fun extractTargetStr(value: String): String {
    if (value.startsWith("maerd") || value.startsWith("esare")) {
        return value.substring(5)
    }
    if (value.startsWith("resare")) {
        return value.substring(6)
    }
    if (value.startsWith("remaerd")) {
        return value.substring(7)
    }
    return value
}