s = input()[::-1]

def solve(s):
    if s in ["maerd","remaerd","esare","resare"]:
        return True
    elif len(s) <= 7:
        return False
    if s[0:5] in ["maerd","esare"]:
        return solve(s[5:])
    if s[0:6] == "resare":
        return solve(s[6:])
    if s[0:7] == "remaerd":
        return solve(s[7:])
    return False
print("YES" if solve(s) else "NO")