'use strict';
function main(input) {
  let str = input.trim().split('').reverse().join('')
  let beflen = str.length
  let aftlen = 0
  let result = 'NO'
  while(beflen !== aftlen) {
    beflen = str.length
    str = str.replace(/(remaerd|resare)/, '')
    aftlen = str.length
    if(aftlen === beflen) {
      str = str.replace(/(maerd|esare)/, '')
      aftlen = str.length
    }
    if(str === '') {
      result = 'YES'
      console.log(result)
      break
    }
  }
  if (result === 'NO') console.log(result)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));