program main
   implicit none
   character(100000) s,st
   integer le,i
   read(*,*)st
   le=len_trim(st)
   do i=1,le
      s(i:i)=st(le-i+1:le-i+1)
   enddo
   i=1
   do
    !  write(*,*)i
      if(i==le+1)then
         write(*,"(A3)")"YES"
         STOP
      endif
      if(s(i:i+4)=="maerd")then
      i=i+5
      cycle;
     endif
      if(s(i:i+6)=="remaerd")then
      i=i+7
      cycle;
     endif
     if(s(i:i+4)=="esare")then
      i=i+5
      cycle;
     endif
      if(s(i:i+5)=="resare")then
      i=i+6
      cycle;
     endif
     write(*,"(A2)")"NO"
     STOP
      
   enddo
end program main
   
