var S = require('fs').readFileSync('/dev/stdin', 'utf8')
var ans = 0
var status =0
while(status == 0){
  	//console.log(S,status)
  	if(S != ""){
		var seven = S.slice(-7);
      	var six = S.slice(-6)
		var five = S.slice(-5);
      	//console.log(six)
		if(seven =="dreamer"){
	      S = S.slice(0,-7)
    	}
      	else if(six =="eraser"){
	      S = S.slice(0,-6)
    	}
		else if(five == "dream" || five == "erase"){
          //console.log(five)
	      S = S.slice(0,-5)
	    } 
  		else{
      		status = 1
      		console.log("NO")
    	}
    }else{
      status =1;
      console.log("YES")
    }
}
