"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const S = arg[0].split("");
    
    while(S.length > 0) {
        let last5 = S.slice(-5).join("");
        let last6 = S.slice(-6).join("");
        let last7 = S.slice(-7).join("");
        
        if(last5 === "erase" || last5 === "dream") {
            S.splice(S.length - 5, 5);
        } else if(last6 === "eraser") {
            S.splice(S.length - 6, 6);
        } else if(last7 === "dreamer") {
            S.splice(S.length - 7, 7);
        } else {
            console.log("NO");
            return;
        }
    }
    
    console.log("YES");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));