import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;

public class Main {

  public static void main(String[] args) {
    solve(System.in, System.out);
  }

  static void solve(InputStream is, PrintStream os) {
    Scanner sc = new Scanner(is);

    /* read */
    String s = sc.next();

    String[] words = {"dream", "dreamer", "erase", "eraser"};

    if (dfs(s, 0, words)) {
      os.println("YES");
    } else {
      os.println("NO");
    }
  }

  private static boolean dfs(String s, int index, String[] words) {
    if (index == s.length()) return true;
    boolean res = false;
    for (String w : words) {
      String t = s.substring(index, Math.min(index + w.length(), s.length()));
      if (t.equals(w)) {
        res |= dfs(s, index + w.length(), words);
      }
    }
    return res;
 }
}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz