function Main(input) {
    var erased = input.replace(/eraser/g, ' ').replace(/erase/g, ' ').
    replace(/dreamer/g, ' ').replace(/dream/g, ' ');
    var success = true;
  	for (var i = 0; i < erased.length; i++) {
     	if (erased[i] != ' ') {
          success = false;
          break;
        }
    }
  	if (success) {
        console.log("YES\n");
    } else {
        console.log("NO\n");
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));