S = input()[::-1]
W = [s[::-1] for s in ('dream', 'dreamer', 'erase', 'eraser')]


def isOk():
    now = 0
    while now < len(S):
        for w in W:
            if S[now:now + len(w)] == w:
                now += len(w)
                break
        else:
            return False
    return True


print('YES' if isOk() else 'NO')

206b02bb6e24d6082dff86e9c864c73bad3bd00d
<mask token>

<mask token>


def isOk():
    now = 0
    while now < len(S):
        for w in W:
            if S[now:now + len(w)] == w:
                now += len(w)
                break
        else:
            return False
    return True


<mask token>

<mask token>


def isOk():
    now = 0
    while now < len(S):
        for w in W:
            if S[now:now + len(w)] == w:
                now += len(w)
                break
        else:
            return False
    return True


print('YES' if isOk() else 'NO')

S = input()[::-1]
W = [s[::-1] for s in ('dream', 'dreamer', 'erase', 'eraser')]


def isOk():
    now = 0
    while now < len(S):
        for w in W:
            if S[now:now + len(w)] == w:
                now += len(w)
                break
        else:
            return False
    return True


print('YES' if isOk() else 'NO')
