import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    int pos = S.length();
    String ans = "YES";
    while(pos > 0) {
      String s5 = "";
      String s6 = "";
      String s7 = "";
      int count = 0;
      if(pos - 7 >= 0) {
        s7 = S.substring(pos - 7, pos);
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s7.equals("dreamer")) {
          pos -= 7;
          count++;
        } else if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 6 >= 0) {
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 5 >= 0) {
        s5 = S.substring(pos - 5, pos);
        if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      }
      if(count == 0) {
        ans = "NO";
        break;
      }
    }
    System.out.println(ans);
  }
}
/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