"use strict"

function Main(input) {
  let T = String(input.trim());
  T = [...T].reduceRight((p, c) => p + c);
  const Arr = ['dream', 'dreamer' ,'erase' ,'eraser']
  const S = Arr.map(s =>[...s].reduceRight((p, c) => p + c))

  let flg = true;
  while(true){
    let tmp = T.length;
    for(let i=0; i<4; i++){
      if(T.indexOf(S[i]) === 0){
        T = T.slice(S[i].length);
      }
    }
    if(tmp === T.length){
      flg = false;
      break;
    }
    if(T.length === 0){
      break;
    }
  }

  console.log(flg ? 'Yes' : 'No');
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));