import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        String s = new Scanner(System.in).nextLine();
        int i = 0;
        while (i < s.length()) {
            String str5 = s.substring(i, Math.min(i + 5, s.length()));
            if (str5.equals("dream")) {
                i += 5;
                if (i + 1 < s.length() && s.charAt(i) == 'e' && s.charAt(i + 1) == 'r'
                    && (i + 2 == s.length() || s.charAt(i + 2) != 'a')) {
                    i += 2;
                }
            }
            else if (str5.equals("erase")) {
                i += 5;
                if (i < s.length() && s.charAt(i) == 'r') {
                    i++;
                }
            }
            else {
                System.out.println("NO");
                return;
            }
        }
        System.out.println("YES");
    }
}

/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