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