function main(input) {
  const WORDS = ['dreamer', 'eraser', 'dream', 'erase'];
  
  var index = 0;
  var word = "";
  while(true) {
    word = WORDS.find((w) => input.startsWith(w, index));
    if (!word) {
      break;
    }
    index += word.length;
  }
  if (index === input.length) {
    console.log('YES');
  } else {
    console.log('NO');
  }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));