import java.util.*;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        String ans = "YES";

        int index = s.length();

        while (index > 0) {
            boolean isOK = false;

            if (index >= 7 && s.substring(index - 7, index).equals("dreamer")) {
                isOK = true;
                index -= 7;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("dream")) {
                isOK = true;
                index -= 5;
            }
            else if (index >= 6 &&s.substring(index - 6, index).equals("eraser")) {
                isOK = true;
                index -= 6;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("erase")) {
                isOK = true;
                index -= 5;
            }

            if (!isOK) {
                ans = "NO";
                break;
            }
        }

        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        String ans = "YES";

        int index = s.length();

        while (index > 0) {
            boolean isOK = false;

            if (index >= 7 && s.substring(index - 7, index).equals("dreamer")) {
                isOK = true;
                index -= 7;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("dream")) {
                isOK = true;
                index -= 5;
            }
            else if (index >= 6 &&s.substring(index - 6, index).equals("eraser")) {
                isOK = true;
                index -= 6;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("erase")) {
                isOK = true;
                index -= 5;
            }

            if (!isOK) {
                ans = "NO";
                break;
            }
        }

        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        String ans = "YES";

        int index = s.length();

        while (index > 0) {
            boolean isOK = false;

            if (index >= 7 && s.substring(index - 7, index).equals("dreamer")) {
                isOK = true;
                index -= 7;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("dream")) {
                isOK = true;
                index -= 5;
            }
            else if (index >= 6 &&s.substring(index - 6, index).equals("eraser")) {
                isOK = true;
                index -= 6;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("erase")) {
                isOK = true;
                index -= 5;
            }

            if (!isOK) {
                ans = "NO";
                break;
            }
        }

        System.out.println(ans);
    } main {
        // write your code here
        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        String ans = "YES";

        int index = s.length();

        while (index > 0) {
            boolean isOK = false;

            if (index >= 7 && s.substring(index - 7, index).equals("dreamer")) {
                isOK = true;
                index -= 7;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("dream")) {
                isOK = true;
                index -= 5;
            }
            else if (index >= 6 &&s.substring(index - 6, index).equals("eraser")) {
                isOK = true;
                index -= 6;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("erase")) {
                isOK = true;
                index -= 5;
            }

            if (!isOK) {
                ans = "NO";
                break;
            }
        }

        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String ans = "YES"; ans "YES" int index = s.length(); index s.length() s.length s while (index > 0) {
            boolean isOK = false;

            if (index >= 7 && s.substring(index - 7, index).equals("dreamer")) {
                isOK = true;
                index -= 7;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("dream")) {
                isOK = true;
                index -= 5;
            }
            else if (index >= 6 &&s.substring(index - 6, index).equals("eraser")) {
                isOK = true;
                index -= 6;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("erase")) {
                isOK = true;
                index -= 5;
            }

            if (!isOK) {
                ans = "NO";
                break;
            }
        } index > 0 index 0 {
            boolean isOK = false;

            if (index >= 7 && s.substring(index - 7, index).equals("dreamer")) {
                isOK = true;
                index -= 7;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("dream")) {
                isOK = true;
                index -= 5;
            }
            else if (index >= 6 &&s.substring(index - 6, index).equals("eraser")) {
                isOK = true;
                index -= 6;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("erase")) {
                isOK = true;
                index -= 5;
            }

            if (!isOK) {
                ans = "NO";
                break;
            }
        } boolean isOK = false; isOK false if (index >= 7 && s.substring(index - 7, index).equals("dreamer")) {
                isOK = true;
                index -= 7;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("dream")) {
                isOK = true;
                index -= 5;
            }
            else if (index >= 6 &&s.substring(index - 6, index).equals("eraser")) {
                isOK = true;
                index -= 6;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("erase")) {
                isOK = true;
                index -= 5;
            } index >= 7 && s.substring(index - 7, index).equals("dreamer") index >= 7 index 7 s.substring(index - 7, index).equals("dreamer") s.substring(index - 7, index).equals s.substring(index - 7, index) s.substring s index - 7 index 7 index "dreamer" {
                isOK = true;
                index -= 7;
            } isOK = true isOK true index -= 7 index 7 if (index >= 5 && s.substring(index - 5, index).equals("dream")) {
                isOK = true;
                index -= 5;
            }
            else if (index >= 6 &&s.substring(index - 6, index).equals("eraser")) {
                isOK = true;
                index -= 6;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("erase")) {
                isOK = true;
                index -= 5;
            } index >= 5 && s.substring(index - 5, index).equals("dream") index >= 5 index 5 s.substring(index - 5, index).equals("dream") s.substring(index - 5, index).equals s.substring(index - 5, index) s.substring s index - 5 index 5 index "dream" {
                isOK = true;
                index -= 5;
            } isOK = true isOK true index -= 5 index 5 if (index >= 6 &&s.substring(index - 6, index).equals("eraser")) {
                isOK = true;
                index -= 6;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("erase")) {
                isOK = true;
                index -= 5;
            } index >= 6 &&s.substring(index - 6, index).equals("eraser") index >= 6 index 6 s.substring(index - 6, index).equals("eraser") s.substring(index - 6, index).equals s.substring(index - 6, index) s.substring s index - 6 index 6 index "eraser" {
                isOK = true;
                index -= 6;
            } isOK = true isOK true index -= 6 index 6 if (index >= 5 && s.substring(index - 5, index).equals("erase")) {
                isOK = true;
                index -= 5;
            } index >= 5 && s.substring(index - 5, index).equals("erase") index >= 5 index 5 s.substring(index - 5, index).equals("erase") s.substring(index - 5, index).equals s.substring(index - 5, index) s.substring s index - 5 index 5 index "erase" {
                isOK = true;
                index -= 5;
            } isOK = true isOK true index -= 5 index 5 if (!isOK) {
                ans = "NO";
                break;
            } !isOK isOK {
                ans = "NO";
                break;
            } ans = "NO" ans "NO" break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        String ans = "YES";

        int index = s.length();

        while (index > 0) {
            boolean isOK = false;

            if (index >= 7 && s.substring(index - 7, index).equals("dreamer")) {
                isOK = true;
                index -= 7;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("dream")) {
                isOK = true;
                index -= 5;
            }
            else if (index >= 6 &&s.substring(index - 6, index).equals("eraser")) {
                isOK = true;
                index -= 6;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("erase")) {
                isOK = true;
                index -= 5;
            }

            if (!isOK) {
                ans = "NO";
                break;
            }
        }

        System.out.println(ans);
    }
} public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        String ans = "YES";

        int index = s.length();

        while (index > 0) {
            boolean isOK = false;

            if (index >= 7 && s.substring(index - 7, index).equals("dreamer")) {
                isOK = true;
                index -= 7;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("dream")) {
                isOK = true;
                index -= 5;
            }
            else if (index >= 6 &&s.substring(index - 6, index).equals("eraser")) {
                isOK = true;
                index -= 6;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("erase")) {
                isOK = true;
                index -= 5;
            }

            if (!isOK) {
                ans = "NO";
                break;
            }
        }

        System.out.println(ans);
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        String ans = "YES";

        int index = s.length();

        while (index > 0) {
            boolean isOK = false;

            if (index >= 7 && s.substring(index - 7, index).equals("dreamer")) {
                isOK = true;
                index -= 7;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("dream")) {
                isOK = true;
                index -= 5;
            }
            else if (index >= 6 &&s.substring(index - 6, index).equals("eraser")) {
                isOK = true;
                index -= 6;
            }
            else if (index >= 5 && s.substring(index - 5, index).equals("erase")) {
                isOK = true;
                index -= 5;
            }

            if (!isOK) {
                ans = "NO";
                break;
            }
        }

        System.out.println(ans);
    }
}