import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv,
    std.functional, std.math, std.numeric, std.range, std.stdio, std.string,
    std.random, std.typecons, std.container;

ulong MAX = 100_100, MOD = 1_000_000_007, INF = 1_000_000_000_000;
alias sread = () => readln.chomp();
alias lread(T = long) = () => readln.chomp.to!(T);
alias aryread(T = long) = () => readln.split.to!(T[]);
alias Pair = Tuple!(long, "before", long, "after");
alias PQueue(T, alias less = "a>b") = BinaryHeap!(Array!T, less);

void main()
{
    auto s = sread();
    bool check = true;
    long iter;
    while (iter < s.length)
    {
        if (iter + "dreamer".length <= s.length && s[iter .. iter + "dreamer".length] == "dreamer")
        {
            iter += "dreamer".length;
        }
        else if (iter + "dream".length <= s.length && s[iter .. iter + "dream".length] == "dream")
        {
            iter += "dream".length;
        }
        else if (iter + "eraser".length <= s.length && s[iter .. iter + "eraser".length] == "eraser")
        {
            iter += "eraser".length;
        }
        else if (iter + "erase".length <= s.length && s[iter .. iter + "erase".length] == "erase")
        {
            iter += "erase".length;
        }
        else
        {
            check = false;
            break;
        }
        // s[iter .. $].writeln();
    }
    if (check)
        writeln("YES");
    else
        writeln("NO");
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}
