import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time



sys.setrecursionlimit(10**7)

inf=10**20

mod=10**9+7



def LI(): return list(map(int,input().split()))

def I(): return int(eval(input()))

def LS(): return input().split()

def S(): return eval(input())



def main():

  s=S()



  l=['dream','dreamer','erase','eraser']



  while True:

    a=s[-5:]

    b=s[-7:]

    c=s[-6:]



    if a==l[0]:

      s=s[:-5]

    elif b==l[1]:

      s=s[:-7]

    elif a==l[2]:

      s=s[:-5]

    elif c==l[3]:

      s=s[:-6]

    else:

      if s=='':

        return 'YES'

      else:

        return 'NO'



print((main()))

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time



sys.setrecursionlimit(10**7)

inf=10**20

mod=10**9+7



def LI(): return list(map(int,input().split()))

def I(): return int(eval(input()))

def LS(): return input().split()

def S(): return eval(input())



def main():

  s=list(S())



  l=[['d', 'r', 'e', 'a', 'm'],

  ['d', 'r', 'e', 'a', 'm', 'e', 'r'],

  ['e', 'r', 'a', 's', 'e'],

  ['e', 'r', 'a', 's', 'e', 'r']]



  while True:

    if len(s)<=4:

      break

    else:

      if l[0]==s[-5:]:

        [s.pop() for _ in ' '*5]

      elif l[1]==s[-7:]:

        [s.pop() for _ in ' '*7]

      elif l[2]==s[-5:]:

        [s.pop() for _ in ' '*5]

      elif l[3]==s[-6:]:

        [s.pop() for _ in ' '*6]

      else:

        return 'NO'



  if len(s)==0:

    return 'YES'

  return 'NO'



print((main()))

import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7


def LI():
    return list(map(int, input().split()))


def I():
    return int(eval(input()))


def LS():
    return input().split()


def S():
    return eval(input())


def main():
    s = S()
    l = ["dream", "dreamer", "erase", "eraser"]
    while True:
        a = s[-5:]
        b = s[-7:]
        c = s[-6:]
        if a == l[0]:
            s = s[:-5]
        elif b == l[1]:
            s = s[:-7]
        elif a == l[2]:
            s = s[:-5]
        elif c == l[3]:
            s = s[:-6]
        else:
            if s == "":
                return "YES"
            else:
                return "NO"


print((main()))

import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7


def LI():
    return list(map(int, input().split()))


def I():
    return int(eval(input()))


def LS():
    return input().split()


def S():
    return eval(input())


def main():
    s = list(S())
    l = [
        ["d", "r", "e", "a", "m"],
        ["d", "r", "e", "a", "m", "e", "r"],
        ["e", "r", "a", "s", "e"],
        ["e", "r", "a", "s", "e", "r"],
    ]
    while True:
        if len(s) <= 4:
            break
        else:
            if l[0] == s[-5:]:
                [s.pop() for _ in " " * 5]
            elif l[1] == s[-7:]:
                [s.pop() for _ in " " * 7]
            elif l[2] == s[-5:]:
                [s.pop() for _ in " " * 5]
            elif l[3] == s[-6:]:
                [s.pop() for _ in " " * 6]
            else:
                return "NO"
    if len(s) == 0:
        return "YES"
    return "NO"


print((main()))

-    s = S() -    l = ["dream", "dreamer", "erase", "eraser"] +    s = list(S()) +    l = [ +        ["d", "r", "e", "a", "m"], +        ["d", "r", "e", "a", "m", "e", "r"], +        ["e", "r", "a", "s", "e"], +        ["e", "r", "a", "s", "e", "r"], +    ] -        a = s[-5:] -        b = s[-7:] -        c = s[-6:] -        if a == l[0]: -            s = s[:-5] -        elif b == l[1]: -            s = s[:-7] -        elif a == l[2]: -            s = s[:-5] -        elif c == l[3]: -            s = s[:-6] +        if len(s) <= 4: +            break -            if s == "": -                return "YES" +            if l[0] == s[-5:]: +                [s.pop() for _ in " " * 5] +            elif l[1] == s[-7:]: +                [s.pop() for _ in " " * 7] +            elif l[2] == s[-5:]: +                [s.pop() for _ in " " * 5] +            elif l[3] == s[-6:]: +                [s.pop() for _ in " " * 6] +    if len(s) == 0: +        return "YES" +    return "NO"