var S = process.argv[0]
var S_arr = S.split("dreamer")
var ans = 0
S_arr.forEach(function(elem){
  elem.split("eraser").forEach(function(element){
    element.split("dream").forEach(function(erase_elem){
      if(erase_elem != ""){
        ans+=1;
      }else{

      }
    })
  })
})
if(ans == 0){
  console.log("YES")
}else{
  console.log("NO")
}
