'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; 
    }
  }

  // 結果の判定  
  if(txt == '') {
      console.log("YES");
  } else {
      console.log("No");
  }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));