'use strict'

// inputに入力データ全体が入る
function Main(input) {
  let txt = String(input);
  // 文字列から4要素があるかを確認
while(txt){
  if(txt.match('dreamer')){
    txt = txt.replace('dreamer','')
  } else if(txt.match('eraser')){
    txt = txt.replace('eraser','')
  }  else if(txt.match('dream')){
    txt = txt.replace('dream','')
  }  else if(txt.match('erase')){
    txt = txt.replace('erase','')
  } else {
    break; 
  }
}
  let ans = "";
  if(txt == "") {ans = "YES";} else {ans = "No";}
  console.log('%s',ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));