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");
    }
} import java.util.Scanner; Scanner java.util 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");
    }
} 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");
    } main {
        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");
    } String s = new Scanner(System.in).nextLine(); s new Scanner(System.in).nextLine() new Scanner(System.in).nextLine new Scanner(System.in) int i = 0; 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;
            }
        } i < s.length() i s.length() s.length s {
            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;
            }
        } String str5 = s.substring(i, Math.min(i + 5, s.length())); str5 s.substring(i, Math.min(i + 5, s.length())) s.substring s i Math.min(i + 5, s.length()) Math.min Math i + 5 i 5 s.length() s.length s 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;
            } str5.equals("dream") str5.equals str5 "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;
                }
            } i += 5 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;
                } i + 1 < s.length() && s.charAt(i) == 'e' && s.charAt(i + 1) == 'r'
                    && (i + 2 == s.length() || s.charAt(i + 2) != 'a') s.charAt(i + 1) == 'r' i + 1 < s.length() && s.charAt(i) == 'e' && s.charAt(i + 1) == 'r'
                    && (i + 2 == s.length() || s.charAt(i + 2) != 'a') i + 1 < s.length() i + 1 i 1 s.length() s.length s s.charAt(i) == 'e' s.charAt(i) s.charAt s i 'e' s.charAt(i + 1) == 'r' s.charAt(i + 1) s.charAt s i + 1 i 1 'r' (i + 2 == s.length() || s.charAt(i + 2) != 'a') i + 2 == s.length() i + 2 i 2 s.length() s.length s s.charAt(i + 2) != 'a' s.charAt(i + 2) s.charAt s i + 2 i 2 'a' {
                    i += 2;
                } i += 2 i 2 if (str5.equals("erase")) {
                i += 5;
                if (i < s.length() && s.charAt(i) == 'r') {
                    i++;
                }
            }
            else {
                System.out.println("NO");
                return;
            } str5.equals("erase") str5.equals str5 "erase" {
                i += 5;
                if (i < s.length() && s.charAt(i) == 'r') {
                    i++;
                }
            } i += 5 i 5 if (i < s.length() && s.charAt(i) == 'r') {
                    i++;
                } i < s.length() && s.charAt(i) == 'r' i < s.length() i s.length() s.length s s.charAt(i) == 'r' s.charAt(i) s.charAt s i 'r' {
                    i++;
                } i++ i {
                System.out.println("NO");
                return;
            } System.out.println("NO") System.out.println System.out System System.out "NO" return; System.out.println("YES") System.out.println System.out System System.out "YES" String[] args args
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");
    }
}
