function Main(input) {
  input = input.split(" ");
  var S = input[0].replace("\n","");

  var Words = function(){
    this.Can = {"dream":5, "dreamer":7, "erase":5, "eraser":6};
    this.S = S;
    this.dp = [];
    this.T ="";
    this.flag = false;
  }

  Words.prototype = {
    procedure: function(T){
      for(key in this.Can){
        if(this.S == T) this.flag = true;
        if(this.S.length < T.length) return;
        this.procedure(T+key);
      }
      if(this.flag == true){
        return "YES";
      }else{
        return "NO";
      }
    }
  }
  var words = new Words();
  console.log(words.procedure(""));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));