import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    int len = S.length();
    String ans = "NO";
    if(len >= 5) {
      // dp[i]はインデックスi～末尾までの部分文字列に対する判定結果を返す（出来るなら1、出来ないなら-1）
      int[] dp = new int[len + 1];
      dp[len] = 1;
      dp[len - 1] = -1;
      dp[len - 2] = -1;
      dp[len - 3] = -1;
      dp[len - 4] = -1;
      dp[len - 5] = -1;
      String str = S.substring(len - 5);
      if(str.equals("dream") || str.equals("erase")) dp[len - 5] = 1;
      for(int i = len - 6; i >= 0; i--) {
        dp[i] = -1;
        String str5 = S.substring(i, i + 5);
        String str6 = S.substring(i, i + 6);
        if((str5.equals("dream") || str5.equals("erase")) && dp[i + 5] == 1) dp[i] = 1;
        if(str6.equals("eraser") && dp[i + 6] == 1) dp[i] = 1;
        if(i + 7 <= len) {
          String str7 = S.substring(i, i + 7);
          if(str7.equals("dreamer") && dp[i + 7] == 1) dp[i] = 1;
        }
      }
      if(dp[0] == 1) ans = "YES";
    }
    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