function Main(input) {
    const n = input.length;
    states = [[0, 0]];
    while (states.length > 0) {
        var element = states.pop();
        var state = element[0];
        var i = element[1];
        if (i > n) {
            continue;
        } else if (i == n) {
            return "YES";
        }
        if (state == 1) {
            if (n - i >= 2 && input.slice(i, i+2) == "er") {
                states.push([0, i+2]);
            }
        } else if (state == 2) {
            if (n - i >= 1 && input.slice(i, i+1) == "r") {
                states.push([0,i+1]);
            }
        }
        if (n - i >= 5) {
            var cs = input.slice(i, i+5);
            if (cs == "dream") {
                states.push([1, i+5]);
            } else if (cs == "erase") {
                states.push([2, i+5]);
            }
        }
    }
    return "NO";
}
var ans = Main(require("fs").readFileSync("/dev/stdin", "utf8"));
console.log(ans);