import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        System.out.println( solve(S) );
    }

    private static String solve(String S) {
        String s = reverse(S);
        String t1 = reverse("dream");
        String t2 = reverse("dreamer");
        String t3 = reverse("erase");
        String t4 = reverse("eraser");
        int i = 0;

        while(true) {
            i = nextIndexOf(s, i, t1, t2, t3, t4);
            if( i == -1 ) return "NO";
            if( i == s.length() ) return "YES";
        }
    }

    private static String reverse(String s) {
        char[] rev = new char[s.length()];
        for (int i = 0, j = s.length() -1; i < s.length(); i++, j--) {
            rev[j] = s.charAt(i);
        }
        return new String(rev);
    }

    private static int nextIndexOf(String s, int i, String... ts) {
        for (String t : ts) {
            if( s.startsWith(t, i) ) {
                return i + t.length();
            }
        }
        return -1;
    }
}
/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