// ABC 049

// inputに入力データ全体が入る
function Main(input) {
  var str = input;
  // 正規表現による指定
  str = str.replace(/erase/g, '');
  str = str.replace(/eraser/g, '');
  str = str.replace(/dreamer/g, '');
  str = str.replace(/dream/g, '');

  if(str == "") {
    console.log("YES");
  } else {
    str = input;
    str = str.replace(/eraser/g, '');
    str = str.replace(/erase/g, '');
    str = str.replace(/dreamer/g, '');
    str = str.replace(/dream/g, '');
    if(str == "") {
      console.log("YES");
    } else {
      console.log("NO");
    }
  }
}

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