// https://atcoder.jp/contests/abc049/tasks/arc065_a

function main(arg) {
  const S = arg;
  
  const s = S.replace(/dreameraser|dreamerase|dreamer|dream|eraser|erase/g, '');
  if (s == '') {
    console.log('YES');
  } else {
    console.log('NO');
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
