function main(input) {
  const args = input.split('').reverse().join('');
  var rplc1 = /maerd/g;
  var rplc2 = /remaerd/g;
  var rplc3 = /esare/g;
  var rplc4 = /resare/g;
  var i = args.replace(rplc1,'');
  var j = i.replace(rplc2,'');
  console.log(j);
  var k = j.replace(rplc3,'');
  console.log(k);
  var l = k.replace(rplc4,'');
  var m = l === ''
  console.log(m);
  if(!m){
    console.log('NO');
  }else if(m){
    console.log('YES');
  }
  
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));