function main(input) {
  const args = input;
  var rplc1 = /eraser/g;
  var rplc2 = /erase/g;
  var rplc3 = /dreamer/g;
  var rplc4 = /dream/g;
  var i = args.replace(rplc1,'');
  var j = i.replace(rplc2,'');
  var k = j.replace(rplc3,'');
  var l = k.replace(rplc4,'');
  if(l !== ''){
    console.log('NO');
  }else if(l === ''){
    console.log('YES');
  }
  
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));