local long_str = io.read("*l")
local tmps = {"dream", "dreamer", "erase", "eraser"}

long_str = long_str:reverse()
for i = 1, #tmps do
    tmps[i] = string.reverse(tmps[i])
end

local index = 1
local is_none = false
while index < long_str:len() do
    local old_index = index
    for i = 1, #tmps do
        local tmp = tmps[i]
        if long_str:sub(index, index + string.len(tmp) - 1) == tmp then
            index = index + string.len(tmp)
            break
        end
    end
    if old_index == index then
        is_none = true
        break
    end
end
print(is_none and "No" or "Yes")