

import java.util.Scanner;

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

        while (sc.hasNext()) {
            String s = sc.next();
            boolean prevIsDream = false;
            boolean prevIsErase = false;
            int idx = 0;

            while (idx < s.length()) {
                if (s.startsWith("erase", idx)) {
                    idx += 5;
                    prevIsErase = true;
                    prevIsDream = false;
                } else if (s.startsWith("dream", idx)) {
                    idx += 5;
                    prevIsErase = false;
                    prevIsDream = true;
                } else if (s.startsWith("er", idx) && prevIsDream) {
                    idx += 2;
                    prevIsErase = false;
                    prevIsDream = false;
                } else if (s.startsWith("r", idx) && prevIsErase) {
                    idx++;
                    prevIsErase = false;
                    prevIsDream = false;
                } else {
                    break;
                }
            }

            if (idx == s.length()) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        while (sc.hasNext()) {
            String s = sc.next();
            boolean prevIsDream = false;
            boolean prevIsErase = false;
            int idx = 0;

            while (idx < s.length()) {
                if (s.startsWith("erase", idx)) {
                    idx += 5;
                    prevIsErase = true;
                    prevIsDream = false;
                } else if (s.startsWith("dream", idx)) {
                    idx += 5;
                    prevIsErase = false;
                    prevIsDream = true;
                } else if (s.startsWith("er", idx) && prevIsDream) {
                    idx += 2;
                    prevIsErase = false;
                    prevIsDream = false;
                } else if (s.startsWith("r", idx) && prevIsErase) {
                    idx++;
                    prevIsErase = false;
                    prevIsDream = false;
                } else {
                    break;
                }
            }

            if (idx == s.length()) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        while (sc.hasNext()) {
            String s = sc.next();
            boolean prevIsDream = false;
            boolean prevIsErase = false;
            int idx = 0;

            while (idx < s.length()) {
                if (s.startsWith("erase", idx)) {
                    idx += 5;
                    prevIsErase = true;
                    prevIsDream = false;
                } else if (s.startsWith("dream", idx)) {
                    idx += 5;
                    prevIsErase = false;
                    prevIsDream = true;
                } else if (s.startsWith("er", idx) && prevIsDream) {
                    idx += 2;
                    prevIsErase = false;
                    prevIsDream = false;
                } else if (s.startsWith("r", idx) && prevIsErase) {
                    idx++;
                    prevIsErase = false;
                    prevIsDream = false;
                } else {
                    break;
                }
            }

            if (idx == s.length()) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);

        while (sc.hasNext()) {
            String s = sc.next();
            boolean prevIsDream = false;
            boolean prevIsErase = false;
            int idx = 0;

            while (idx < s.length()) {
                if (s.startsWith("erase", idx)) {
                    idx += 5;
                    prevIsErase = true;
                    prevIsDream = false;
                } else if (s.startsWith("dream", idx)) {
                    idx += 5;
                    prevIsErase = false;
                    prevIsDream = true;
                } else if (s.startsWith("er", idx) && prevIsDream) {
                    idx += 2;
                    prevIsErase = false;
                    prevIsDream = false;
                } else if (s.startsWith("r", idx) && prevIsErase) {
                    idx++;
                    prevIsErase = false;
                    prevIsDream = false;
                } else {
                    break;
                }
            }

            if (idx == s.length()) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while (sc.hasNext()) {
            String s = sc.next();
            boolean prevIsDream = false;
            boolean prevIsErase = false;
            int idx = 0;

            while (idx < s.length()) {
                if (s.startsWith("erase", idx)) {
                    idx += 5;
                    prevIsErase = true;
                    prevIsDream = false;
                } else if (s.startsWith("dream", idx)) {
                    idx += 5;
                    prevIsErase = false;
                    prevIsDream = true;
                } else if (s.startsWith("er", idx) && prevIsDream) {
                    idx += 2;
                    prevIsErase = false;
                    prevIsDream = false;
                } else if (s.startsWith("r", idx) && prevIsErase) {
                    idx++;
                    prevIsErase = false;
                    prevIsDream = false;
                } else {
                    break;
                }
            }

            if (idx == s.length()) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        } sc.hasNext() sc.hasNext sc {
            String s = sc.next();
            boolean prevIsDream = false;
            boolean prevIsErase = false;
            int idx = 0;

            while (idx < s.length()) {
                if (s.startsWith("erase", idx)) {
                    idx += 5;
                    prevIsErase = true;
                    prevIsDream = false;
                } else if (s.startsWith("dream", idx)) {
                    idx += 5;
                    prevIsErase = false;
                    prevIsDream = true;
                } else if (s.startsWith("er", idx) && prevIsDream) {
                    idx += 2;
                    prevIsErase = false;
                    prevIsDream = false;
                } else if (s.startsWith("r", idx) && prevIsErase) {
                    idx++;
                    prevIsErase = false;
                    prevIsDream = false;
                } else {
                    break;
                }
            }

            if (idx == s.length()) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        } String s = sc.next(); s sc.next() sc.next sc boolean prevIsDream = false; prevIsDream false boolean prevIsErase = false; prevIsErase false int idx = 0; idx 0 while (idx < s.length()) {
                if (s.startsWith("erase", idx)) {
                    idx += 5;
                    prevIsErase = true;
                    prevIsDream = false;
                } else if (s.startsWith("dream", idx)) {
                    idx += 5;
                    prevIsErase = false;
                    prevIsDream = true;
                } else if (s.startsWith("er", idx) && prevIsDream) {
                    idx += 2;
                    prevIsErase = false;
                    prevIsDream = false;
                } else if (s.startsWith("r", idx) && prevIsErase) {
                    idx++;
                    prevIsErase = false;
                    prevIsDream = false;
                } else {
                    break;
                }
            } idx < s.length() idx s.length() s.length s {
                if (s.startsWith("erase", idx)) {
                    idx += 5;
                    prevIsErase = true;
                    prevIsDream = false;
                } else if (s.startsWith("dream", idx)) {
                    idx += 5;
                    prevIsErase = false;
                    prevIsDream = true;
                } else if (s.startsWith("er", idx) && prevIsDream) {
                    idx += 2;
                    prevIsErase = false;
                    prevIsDream = false;
                } else if (s.startsWith("r", idx) && prevIsErase) {
                    idx++;
                    prevIsErase = false;
                    prevIsDream = false;
                } else {
                    break;
                }
            } if (s.startsWith("erase", idx)) {
                    idx += 5;
                    prevIsErase = true;
                    prevIsDream = false;
                } else if (s.startsWith("dream", idx)) {
                    idx += 5;
                    prevIsErase = false;
                    prevIsDream = true;
                } else if (s.startsWith("er", idx) && prevIsDream) {
                    idx += 2;
                    prevIsErase = false;
                    prevIsDream = false;
                } else if (s.startsWith("r", idx) && prevIsErase) {
                    idx++;
                    prevIsErase = false;
                    prevIsDream = false;
                } else {
                    break;
                } s.startsWith("erase", idx) s.startsWith s "erase" idx {
                    idx += 5;
                    prevIsErase = true;
                    prevIsDream = false;
                } idx += 5 idx 5 prevIsErase = true prevIsErase true prevIsDream = false prevIsDream false if (s.startsWith("dream", idx)) {
                    idx += 5;
                    prevIsErase = false;
                    prevIsDream = true;
                } else if (s.startsWith("er", idx) && prevIsDream) {
                    idx += 2;
                    prevIsErase = false;
                    prevIsDream = false;
                } else if (s.startsWith("r", idx) && prevIsErase) {
                    idx++;
                    prevIsErase = false;
                    prevIsDream = false;
                } else {
                    break;
                } s.startsWith("dream", idx) s.startsWith s "dream" idx {
                    idx += 5;
                    prevIsErase = false;
                    prevIsDream = true;
                } idx += 5 idx 5 prevIsErase = false prevIsErase false prevIsDream = true prevIsDream true if (s.startsWith("er", idx) && prevIsDream) {
                    idx += 2;
                    prevIsErase = false;
                    prevIsDream = false;
                } else if (s.startsWith("r", idx) && prevIsErase) {
                    idx++;
                    prevIsErase = false;
                    prevIsDream = false;
                } else {
                    break;
                } s.startsWith("er", idx) && prevIsDream s.startsWith("er", idx) s.startsWith s "er" idx prevIsDream {
                    idx += 2;
                    prevIsErase = false;
                    prevIsDream = false;
                } idx += 2 idx 2 prevIsErase = false prevIsErase false prevIsDream = false prevIsDream false if (s.startsWith("r", idx) && prevIsErase) {
                    idx++;
                    prevIsErase = false;
                    prevIsDream = false;
                } else {
                    break;
                } s.startsWith("r", idx) && prevIsErase s.startsWith("r", idx) s.startsWith s "r" idx prevIsErase {
                    idx++;
                    prevIsErase = false;
                    prevIsDream = false;
                } idx++ idx prevIsErase = false prevIsErase false prevIsDream = false prevIsDream false {
                    break;
                } break; if (idx == s.length()) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            } idx == s.length() idx s.length() s.length s {
                System.out.println("YES");
            } System.out.println("YES") System.out.println System.out System System.out "YES" {
                System.out.println("NO");
            } System.out.println("NO") System.out.println System.out System System.out "NO" String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        while (sc.hasNext()) {
            String s = sc.next();
            boolean prevIsDream = false;
            boolean prevIsErase = false;
            int idx = 0;

            while (idx < s.length()) {
                if (s.startsWith("erase", idx)) {
                    idx += 5;
                    prevIsErase = true;
                    prevIsDream = false;
                } else if (s.startsWith("dream", idx)) {
                    idx += 5;
                    prevIsErase = false;
                    prevIsDream = true;
                } else if (s.startsWith("er", idx) && prevIsDream) {
                    idx += 2;
                    prevIsErase = false;
                    prevIsDream = false;
                } else if (s.startsWith("r", idx) && prevIsErase) {
                    idx++;
                    prevIsErase = false;
                    prevIsDream = false;
                } else {
                    break;
                }
            }

            if (idx == s.length()) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        while (sc.hasNext()) {
            String s = sc.next();
            boolean prevIsDream = false;
            boolean prevIsErase = false;
            int idx = 0;

            while (idx < s.length()) {
                if (s.startsWith("erase", idx)) {
                    idx += 5;
                    prevIsErase = true;
                    prevIsDream = false;
                } else if (s.startsWith("dream", idx)) {
                    idx += 5;
                    prevIsErase = false;
                    prevIsDream = true;
                } else if (s.startsWith("er", idx) && prevIsDream) {
                    idx += 2;
                    prevIsErase = false;
                    prevIsDream = false;
                } else if (s.startsWith("r", idx) && prevIsErase) {
                    idx++;
                    prevIsErase = false;
                    prevIsDream = false;
                } else {
                    break;
                }
            }

            if (idx == s.length()) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }
} Main


import java.util.Scanner;

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

        while (sc.hasNext()) {
            String s = sc.next();
            boolean prevIsDream = false;
            boolean prevIsErase = false;
            int idx = 0;

            while (idx < s.length()) {
                if (s.startsWith("erase", idx)) {
                    idx += 5;
                    prevIsErase = true;
                    prevIsDream = false;
                } else if (s.startsWith("dream", idx)) {
                    idx += 5;
                    prevIsErase = false;
                    prevIsDream = true;
                } else if (s.startsWith("er", idx) && prevIsDream) {
                    idx += 2;
                    prevIsErase = false;
                    prevIsDream = false;
                } else if (s.startsWith("r", idx) && prevIsErase) {
                    idx++;
                    prevIsErase = false;
                    prevIsDream = false;
                } else {
                    break;
                }
            }

            if (idx == s.length()) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }
}
