'use strict'

function main(s) {

  const set = new Set(['maerd', 'remaerd', 'esare', 'resare']);
  let str = s.split('\n')[0].split('').reverse().join('');

  const sliceHead = (head) => {
    if (head.length < 5) return false;

    for (let i = 5; i <= 7; i++) {
      let sliced = head.slice(0, i);
      if (set.has(sliced)) {
        str = head.slice(i);
        return true;
      }
    }
    
    return false;
  }

  while (sliceHead(str));

  const ans = (str.length === 0) ? 'YES' : 'NO';
  console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
