import Foundation
var S = readLine()!
while true {
    if S.hasSuffix("dream") || S.hasSuffix("erase") {
        S = S.substringToIndex(S.endIndex.advancedBy(-5))
    } else if S.hasSuffix("eraser") {
        S = S.substringToIndex(S.endIndex.advancedBy(-6))
    } else if S.hasSuffix("dreamer") {
        S = S.substringToIndex(S.endIndex.advancedBy(-7))
    } else {
        break
    }
}
print(S=="" ?"YES":"NO")