import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        int N = S.length();

        int i = 0;
        while (i <= N - 1) {
            if (i + 6 <= N && S.substring(i, i + 6).equals("eraser")) {
                i += 6;
                continue;
            }

            if (i + 5 <= N && S.substring(i, i + 5).equals("erase")) {
                i += 5;
                continue;
            }

            if (i + 5 <= N && !S.substring(i, i + 5).equals("dream")) {
                System.out.println("NO");
                return;
            }

            if (i + 7 <= N && S.substring(i, i + 7).equals("dreamer")) {
                if (i + 8 <= N && S.substring(i, i + 8).equals("dreamera")) {
                    // dream
                    i += 5;
                    continue;
                }

                // dreamer
                i += 7;
                continue;
            }

            if (i + 5 <= N && S.substring(i, i + 5).equals("dream")) {
                i += 5;
                continue;
            }

            System.out.println("NO");
            return;
        }

        System.out.println("YES");
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        int N = S.length();

        int i = 0;
        while (i <= N - 1) {
            if (i + 6 <= N && S.substring(i, i + 6).equals("eraser")) {
                i += 6;
                continue;
            }

            if (i + 5 <= N && S.substring(i, i + 5).equals("erase")) {
                i += 5;
                continue;
            }

            if (i + 5 <= N && !S.substring(i, i + 5).equals("dream")) {
                System.out.println("NO");
                return;
            }

            if (i + 7 <= N && S.substring(i, i + 7).equals("dreamer")) {
                if (i + 8 <= N && S.substring(i, i + 8).equals("dreamera")) {
                    // dream
                    i += 5;
                    continue;
                }

                // dreamer
                i += 7;
                continue;
            }

            if (i + 5 <= N && S.substring(i, i + 5).equals("dream")) {
                i += 5;
                continue;
            }

            System.out.println("NO");
            return;
        }

        System.out.println("YES");
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        int N = S.length();

        int i = 0;
        while (i <= N - 1) {
            if (i + 6 <= N && S.substring(i, i + 6).equals("eraser")) {
                i += 6;
                continue;
            }

            if (i + 5 <= N && S.substring(i, i + 5).equals("erase")) {
                i += 5;
                continue;
            }

            if (i + 5 <= N && !S.substring(i, i + 5).equals("dream")) {
                System.out.println("NO");
                return;
            }

            if (i + 7 <= N && S.substring(i, i + 7).equals("dreamer")) {
                if (i + 8 <= N && S.substring(i, i + 8).equals("dreamera")) {
                    // dream
                    i += 5;
                    continue;
                }

                // dreamer
                i += 7;
                continue;
            }

            if (i + 5 <= N && S.substring(i, i + 5).equals("dream")) {
                i += 5;
                continue;
            }

            System.out.println("NO");
            return;
        }

        System.out.println("YES");
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        int N = S.length();

        int i = 0;
        while (i <= N - 1) {
            if (i + 6 <= N && S.substring(i, i + 6).equals("eraser")) {
                i += 6;
                continue;
            }

            if (i + 5 <= N && S.substring(i, i + 5).equals("erase")) {
                i += 5;
                continue;
            }

            if (i + 5 <= N && !S.substring(i, i + 5).equals("dream")) {
                System.out.println("NO");
                return;
            }

            if (i + 7 <= N && S.substring(i, i + 7).equals("dreamer")) {
                if (i + 8 <= N && S.substring(i, i + 8).equals("dreamera")) {
                    // dream
                    i += 5;
                    continue;
                }

                // dreamer
                i += 7;
                continue;
            }

            if (i + 5 <= N && S.substring(i, i + 5).equals("dream")) {
                i += 5;
                continue;
            }

            System.out.println("NO");
            return;
        }

        System.out.println("YES");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc int N = S.length(); N S.length() S.length S int i = 0; i 0 while (i <= N - 1) {
            if (i + 6 <= N && S.substring(i, i + 6).equals("eraser")) {
                i += 6;
                continue;
            }

            if (i + 5 <= N && S.substring(i, i + 5).equals("erase")) {
                i += 5;
                continue;
            }

            if (i + 5 <= N && !S.substring(i, i + 5).equals("dream")) {
                System.out.println("NO");
                return;
            }

            if (i + 7 <= N && S.substring(i, i + 7).equals("dreamer")) {
                if (i + 8 <= N && S.substring(i, i + 8).equals("dreamera")) {
                    // dream
                    i += 5;
                    continue;
                }

                // dreamer
                i += 7;
                continue;
            }

            if (i + 5 <= N && S.substring(i, i + 5).equals("dream")) {
                i += 5;
                continue;
            }

            System.out.println("NO");
            return;
        } i <= N - 1 i N - 1 N 1 {
            if (i + 6 <= N && S.substring(i, i + 6).equals("eraser")) {
                i += 6;
                continue;
            }

            if (i + 5 <= N && S.substring(i, i + 5).equals("erase")) {
                i += 5;
                continue;
            }

            if (i + 5 <= N && !S.substring(i, i + 5).equals("dream")) {
                System.out.println("NO");
                return;
            }

            if (i + 7 <= N && S.substring(i, i + 7).equals("dreamer")) {
                if (i + 8 <= N && S.substring(i, i + 8).equals("dreamera")) {
                    // dream
                    i += 5;
                    continue;
                }

                // dreamer
                i += 7;
                continue;
            }

            if (i + 5 <= N && S.substring(i, i + 5).equals("dream")) {
                i += 5;
                continue;
            }

            System.out.println("NO");
            return;
        } if (i + 6 <= N && S.substring(i, i + 6).equals("eraser")) {
                i += 6;
                continue;
            } i + 6 <= N && S.substring(i, i + 6).equals("eraser") i + 6 <= N i + 6 i 6 N S.substring(i, i + 6).equals("eraser") S.substring(i, i + 6).equals S.substring(i, i + 6) S.substring S i i + 6 i 6 "eraser" {
                i += 6;
                continue;
            } i += 6 i 6 continue; if (i + 5 <= N && S.substring(i, i + 5).equals("erase")) {
                i += 5;
                continue;
            } i + 5 <= N && S.substring(i, i + 5).equals("erase") i + 5 <= N i + 5 i 5 N S.substring(i, i + 5).equals("erase") S.substring(i, i + 5).equals S.substring(i, i + 5) S.substring S i i + 5 i 5 "erase" {
                i += 5;
                continue;
            } i += 5 i 5 continue; if (i + 5 <= N && !S.substring(i, i + 5).equals("dream")) {
                System.out.println("NO");
                return;
            } i + 5 <= N && !S.substring(i, i + 5).equals("dream") i + 5 <= N i + 5 i 5 N !S.substring(i, i + 5).equals("dream") S.substring(i, i + 5).equals("dream") S.substring(i, i + 5).equals S.substring(i, i + 5) S.substring S i i + 5 i 5 "dream" {
                System.out.println("NO");
                return;
            } System.out.println("NO") System.out.println System.out System System.out "NO" return; if (i + 7 <= N && S.substring(i, i + 7).equals("dreamer")) {
                if (i + 8 <= N && S.substring(i, i + 8).equals("dreamera")) {
                    // dream
                    i += 5;
                    continue;
                }

                // dreamer
                i += 7;
                continue;
            } i + 7 <= N && S.substring(i, i + 7).equals("dreamer") i + 7 <= N i + 7 i 7 N S.substring(i, i + 7).equals("dreamer") S.substring(i, i + 7).equals S.substring(i, i + 7) S.substring S i i + 7 i 7 "dreamer" {
                if (i + 8 <= N && S.substring(i, i + 8).equals("dreamera")) {
                    // dream
                    i += 5;
                    continue;
                }

                // dreamer
                i += 7;
                continue;
            } if (i + 8 <= N && S.substring(i, i + 8).equals("dreamera")) {
                    // dream
                    i += 5;
                    continue;
                } i + 8 <= N && S.substring(i, i + 8).equals("dreamera") i + 8 <= N i + 8 i 8 N S.substring(i, i + 8).equals("dreamera") S.substring(i, i + 8).equals S.substring(i, i + 8) S.substring S i i + 8 i 8 "dreamera" {
                    // dream
                    i += 5;
                    continue;
                } i += 5 i 5 continue; i += 7 i 7 continue; if (i + 5 <= N && S.substring(i, i + 5).equals("dream")) {
                i += 5;
                continue;
            } i + 5 <= N && S.substring(i, i + 5).equals("dream") i + 5 <= N i + 5 i 5 N S.substring(i, i + 5).equals("dream") S.substring(i, i + 5).equals S.substring(i, i + 5) S.substring S i i + 5 i 5 "dream" {
                i += 5;
                continue;
            } i += 5 i 5 continue; 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 public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        int N = S.length();

        int i = 0;
        while (i <= N - 1) {
            if (i + 6 <= N && S.substring(i, i + 6).equals("eraser")) {
                i += 6;
                continue;
            }

            if (i + 5 <= N && S.substring(i, i + 5).equals("erase")) {
                i += 5;
                continue;
            }

            if (i + 5 <= N && !S.substring(i, i + 5).equals("dream")) {
                System.out.println("NO");
                return;
            }

            if (i + 7 <= N && S.substring(i, i + 7).equals("dreamer")) {
                if (i + 8 <= N && S.substring(i, i + 8).equals("dreamera")) {
                    // dream
                    i += 5;
                    continue;
                }

                // dreamer
                i += 7;
                continue;
            }

            if (i + 5 <= N && S.substring(i, i + 5).equals("dream")) {
                i += 5;
                continue;
            }

            System.out.println("NO");
            return;
        }

        System.out.println("YES");
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        int N = S.length();

        int i = 0;
        while (i <= N - 1) {
            if (i + 6 <= N && S.substring(i, i + 6).equals("eraser")) {
                i += 6;
                continue;
            }

            if (i + 5 <= N && S.substring(i, i + 5).equals("erase")) {
                i += 5;
                continue;
            }

            if (i + 5 <= N && !S.substring(i, i + 5).equals("dream")) {
                System.out.println("NO");
                return;
            }

            if (i + 7 <= N && S.substring(i, i + 7).equals("dreamer")) {
                if (i + 8 <= N && S.substring(i, i + 8).equals("dreamera")) {
                    // dream
                    i += 5;
                    continue;
                }

                // dreamer
                i += 7;
                continue;
            }

            if (i + 5 <= N && S.substring(i, i + 5).equals("dream")) {
                i += 5;
                continue;
            }

            System.out.println("NO");
            return;
        }

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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        int N = S.length();

        int i = 0;
        while (i <= N - 1) {
            if (i + 6 <= N && S.substring(i, i + 6).equals("eraser")) {
                i += 6;
                continue;
            }

            if (i + 5 <= N && S.substring(i, i + 5).equals("erase")) {
                i += 5;
                continue;
            }

            if (i + 5 <= N && !S.substring(i, i + 5).equals("dream")) {
                System.out.println("NO");
                return;
            }

            if (i + 7 <= N && S.substring(i, i + 7).equals("dreamer")) {
                if (i + 8 <= N && S.substring(i, i + 8).equals("dreamera")) {
                    // dream
                    i += 5;
                    continue;
                }

                // dreamer
                i += 7;
                continue;
            }

            if (i + 5 <= N && S.substring(i, i + 5).equals("dream")) {
                i += 5;
                continue;
            }

            System.out.println("NO");
            return;
        }

        System.out.println("YES");
    }
}