process.stdin.resume();
process.stdin.setEncoding('utf8');

function Main(input) {
  var inputs = input.split(" ");
  var S = inputs[0];
  var reverseS = S.split("").reverse().join("");
  var reversedString = ["dreamer", "eraser", "dream", "erase"].map(function (e) {
    return e.split("").reverse().join("");
  });
  var isisis = true;

  for (var i = 0; i < reverseS.length;) {
    var isis = false;

    for (var j = 0; j < reversedString.length; j++) {
      if (reverseS.substr(i, reversedString[j].length) === reversedString[j]) {
        i += reversedString[j].length;
        isis = true;
      }
    }

    if (!isis) {
      isisis = false;
      break;
    }
  }

  console.log(isisis ? "YES" : "NO");
}

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