function main(argString) {
  if (argString.length === 0) {
    console.log('NO')
    return;
  }
  var input = argString;
  var list = ['dreamer', 'eraser', 'dream', 'erase'];
  var check = true;
  while (check && input.length > 0) {
    check = false;
    for (var i = 0; i < list.length; i++) {
      if (input.endsWith(list[i])) {
        input = input.substr(0, input.length - list[i].length);
        check = true;
        break;
      }
    }
  }
  console.log(check ? 'YES' : 'NO');
}
 
main(require("fs").readFileSync("/dev/stdin", "utf8"));
