function r_search(input){
  var dream = false;
  var dreamer = false;
  var erase = false;
  var eraser = false;
  //const words = []

  if(input.startsWith('dreamer')){
    if(input == 'dreamer'){return true;}
    if(input.substring(5) == ''){return false;}
    dreamer = r_search(input.substring(7))
  }
  if(input.startsWith('dream')){
    if(input == 'dream'){return true;}
    if(input.substring(5) == ''){return false;}
    dream = r_search(input.substring(5))
  }
  if(input.startsWith('eraser')){
    if(input == 'eraser'){return true;}
    if(input.substring(5) == ''){return false;}
    eraser = r_search(input.substring(6))
  }
  if(input.startsWith('erase')){
    if(input == 'erase'){return true;}
    if(input.substring(5) == ''){return false;}
    erase = r_search(input.substring(5))
  }
  
  return (dream || dreamer || erase || eraser)

}
function main(input) {
  if(r_search(input)){
    console.log('YES');
  }else{
    console.log('NO');
  }
}
 
main(require('fs').readFileSync('/dev/stdin', 'utf8'));