import java.util.*;

public class Main {
    static int modP = 1000000007;

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

        int idx = s.length();
        boolean cond = false;
        while(idx >= 0) {
            if(cond) break;
            if(idx < 5) {
                print("NO");
                return;
            }

            String last5 = s.substring(idx-5, idx);
            if(last5.equals("dream") || last5.equals("erase")) {
                idx -= 5;
                if(idx == 0) cond = true;
                continue;
            }

            String last6 = s.substring(idx-6, idx);
            if(last6.equals("eraser")) {
                idx -= 6;
                if(idx == 0) cond = true;
                continue;
            }

            String last7 = s.substring(idx-7, idx);
            if(last7.equals("dreamer")) {
                idx -= 7;
                if(idx == 0) cond = true;
                continue;
            }

            break;
        }

        if(cond) {
            print("YES");
        }else{
            print("NO");
        }
    }

    static void print(String s) {
        System.out.println(s);
    }

    static void print(int i) {
        System.out.println(i);
    }
}

/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