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

function main(arg) {
  let S = arg.trim();
  let T = S;
  
  do {
    S = T;
    T = S.replace(/(dreameraser|dreamerase|dreamer|dream|eraser|erase)$/, '');
  } while (T.length < S.length);
  if (T == '') {
    console.log('YES');
  } else {
    console.log('NO');
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
