'use strict';
function main(input) {
  let str = input
  let beflen = str.length
  let aftlen = 0
  let result = 'NO'
  while(beflen !== aftlen) {
    str = str.replace(/(dream|dreamer|erase|eraser)/, '');
    if(str === '') {
      result = 'YES'
      console.log(result)
      break
    }
  }
  if (result === 'NO') console.log(result)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));