var S = require('fs').readFileSync('/dev/stdin', 'utf8')
var S_arr = S.split("dreamer")
var ans = 0
//console.log(S)
S_arr.forEach(function(elem){
  //console.log(elem)
  elem.split("eraser").forEach(function(element){
    //console.log(element)
    element.split("dream").forEach(function(erase_elem){
      //console.log(erase_elem)
      erase_elem.split("erase").forEach(function(erase_erase){
        //console.log(erase_erase)
	      if(erase_erase != ""){
    	    ans+=1;
    	  }else{
	
    	  }
      });
    })
  })
})
if(ans == 0){
  console.log("YES")
}else{
  console.log("NO")
}
