import java.util.*;

public class Main {
    public static void main(String... args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        sc.close();

        ArrayList<String> word_list = new ArrayList(Arrays.asList("dream", "dreamer", "erase", "eraser"));
        char[] S_char_list = new StringBuilder(S).reverse().toString().toCharArray();

        int idx = 0;
        int tmp_idx = 0;

        boolean next_flg = true;
        while (idx < S_char_list.length) {
            for (String word : word_list) {
                tmp_idx = idx;
                next_flg = true;
                for (int i = word.length() - 1; i >= 0; i--, tmp_idx++) {
                    if (S_char_list[tmp_idx] != word.charAt(i)) {
                        next_flg = false;
                        break;
                    }
                }
                if (next_flg) {
                    idx += word.length();
                    break;
                }
            }
            if (!next_flg)
                break;
        }

        System.out.println(idx >= S_char_list.length ? "YES" : "NO");
    }
}
/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