import java.util.*;

/**
 * Created by Seiya on 2016/10/16.
 */
public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String t = scanner.next();
        String s = new String();


        String[] mozi = new String[4];

        mozi[0] = "dream";
        mozi[1] = "dreamer";
        mozi[2] = "erase";
        mozi[3] = "eraser";

        int ok = -1;
        String temp = new String();
        int min;
        int len = t.length();
        while(ok == -1){

            for (int i = 0; i < 4; i++) {
                min = Math.min(len, mozi[i].length());
                 temp = t.substring(len - min, len);
                if(temp.equals(mozi[i])){
                    len -= min;
                    ok = -1;
                    break;
                }
                ok = 0;
            }
            if(len == 0){
                ok = 1;
            }

        }
        if(ok == 0){
            System.out.println("NO");
        }else {
            System.out.println("YES");
        }


    }


    public static String reverse(String s){
        String ans = new String();

        for (int i = s.length() - 1; i >= 0; i--) {
            ans = ans + s.charAt(i);
        }

        return 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