import java.io.IOException;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import java.io.PrintWriter;

@SuppressWarnings("unchecked")
public class Main {
    static boolean f(String s, int tmp, char[] a) {
        int start = tmp - a.length;
        int end = tmp;

        boolean flg = true;

        int idx = 0;

        for (int i = start; i < end; i++) {
            if (start < 0) break;
            if (s.charAt(i) != a[idx]) {
                flg = false;
                break;
            }
            idx++;
        }

        return flg;
    }

    public static void main(String[] args) throws IOException {
        final String YES = "YES";
        final String NO = "NO";

        final char dream[] = {'d','r','e','a','m'};
        final char dreamer[] = {'d','r','e','a','m','e','r'};
        final char erase[] = {'e', 'r', 'a', 's', 'e'};
        final char eraser[] = {'e','r','a','s','e','r'};

        String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        PrintWriter out = new PrintWriter(System.out);

        boolean flg = false;

        int tmp = s.length();

        while (0 < tmp) {
            boolean result = false;

            flg = f(s, tmp, dream);
            result = result | flg;
            if (flg) {
                tmp -= dream.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, dreamer);
            result = result | flg;
            if (flg) {
                tmp -= dreamer.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, erase);
            result = result | flg;
            if (flg) {
                tmp -= erase.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, eraser);
            result = result | flg;
            if (flg) {
                tmp -= eraser.length;
                if (tmp == 0) break;
            }

            if (!result) break;
        }

        out.println(flg ? YES : NO);

        out.flush();
    }
} import java.io.IOException; IOException java.io import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io public class Main {
    static boolean f(String s, int tmp, char[] a) {
        int start = tmp - a.length;
        int end = tmp;

        boolean flg = true;

        int idx = 0;

        for (int i = start; i < end; i++) {
            if (start < 0) break;
            if (s.charAt(i) != a[idx]) {
                flg = false;
                break;
            }
            idx++;
        }

        return flg;
    }

    public static void main(String[] args) throws IOException {
        final String YES = "YES";
        final String NO = "NO";

        final char dream[] = {'d','r','e','a','m'};
        final char dreamer[] = {'d','r','e','a','m','e','r'};
        final char erase[] = {'e', 'r', 'a', 's', 'e'};
        final char eraser[] = {'e','r','a','s','e','r'};

        String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        PrintWriter out = new PrintWriter(System.out);

        boolean flg = false;

        int tmp = s.length();

        while (0 < tmp) {
            boolean result = false;

            flg = f(s, tmp, dream);
            result = result | flg;
            if (flg) {
                tmp -= dream.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, dreamer);
            result = result | flg;
            if (flg) {
                tmp -= dreamer.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, erase);
            result = result | flg;
            if (flg) {
                tmp -= erase.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, eraser);
            result = result | flg;
            if (flg) {
                tmp -= eraser.length;
                if (tmp == 0) break;
            }

            if (!result) break;
        }

        out.println(flg ? YES : NO);

        out.flush();
    }
} Main static boolean f(String s, int tmp, char[] a) {
        int start = tmp - a.length;
        int end = tmp;

        boolean flg = true;

        int idx = 0;

        for (int i = start; i < end; i++) {
            if (start < 0) break;
            if (s.charAt(i) != a[idx]) {
                flg = false;
                break;
            }
            idx++;
        }

        return flg;
    } f {
        int start = tmp - a.length;
        int end = tmp;

        boolean flg = true;

        int idx = 0;

        for (int i = start; i < end; i++) {
            if (start < 0) break;
            if (s.charAt(i) != a[idx]) {
                flg = false;
                break;
            }
            idx++;
        }

        return flg;
    } int start = tmp - a.length; start tmp - a.length tmp a.length a a.length int end = tmp; end tmp boolean flg = true; flg true int idx = 0; idx 0 for (int i = start; i < end; i++) {
            if (start < 0) break;
            if (s.charAt(i) != a[idx]) {
                flg = false;
                break;
            }
            idx++;
        } int i = start; int i = start; i start i < end i end i++ i++ i {
            if (start < 0) break;
            if (s.charAt(i) != a[idx]) {
                flg = false;
                break;
            }
            idx++;
        } {
            if (start < 0) break;
            if (s.charAt(i) != a[idx]) {
                flg = false;
                break;
            }
            idx++;
        } if (start < 0) break; start < 0 start 0 break; if (s.charAt(i) != a[idx]) {
                flg = false;
                break;
            } s.charAt(i) != a[idx] s.charAt(i) s.charAt s i a[idx] a idx {
                flg = false;
                break;
            } flg = false flg false break; idx++ idx return flg; flg String s s int tmp tmp char[] a a public static void main(String[] args) throws IOException {
        final String YES = "YES";
        final String NO = "NO";

        final char dream[] = {'d','r','e','a','m'};
        final char dreamer[] = {'d','r','e','a','m','e','r'};
        final char erase[] = {'e', 'r', 'a', 's', 'e'};
        final char eraser[] = {'e','r','a','s','e','r'};

        String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        PrintWriter out = new PrintWriter(System.out);

        boolean flg = false;

        int tmp = s.length();

        while (0 < tmp) {
            boolean result = false;

            flg = f(s, tmp, dream);
            result = result | flg;
            if (flg) {
                tmp -= dream.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, dreamer);
            result = result | flg;
            if (flg) {
                tmp -= dreamer.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, erase);
            result = result | flg;
            if (flg) {
                tmp -= erase.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, eraser);
            result = result | flg;
            if (flg) {
                tmp -= eraser.length;
                if (tmp == 0) break;
            }

            if (!result) break;
        }

        out.println(flg ? YES : NO);

        out.flush();
    } main {
        final String YES = "YES";
        final String NO = "NO";

        final char dream[] = {'d','r','e','a','m'};
        final char dreamer[] = {'d','r','e','a','m','e','r'};
        final char erase[] = {'e', 'r', 'a', 's', 'e'};
        final char eraser[] = {'e','r','a','s','e','r'};

        String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        PrintWriter out = new PrintWriter(System.out);

        boolean flg = false;

        int tmp = s.length();

        while (0 < tmp) {
            boolean result = false;

            flg = f(s, tmp, dream);
            result = result | flg;
            if (flg) {
                tmp -= dream.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, dreamer);
            result = result | flg;
            if (flg) {
                tmp -= dreamer.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, erase);
            result = result | flg;
            if (flg) {
                tmp -= erase.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, eraser);
            result = result | flg;
            if (flg) {
                tmp -= eraser.length;
                if (tmp == 0) break;
            }

            if (!result) break;
        }

        out.println(flg ? YES : NO);

        out.flush();
    } final String YES = "YES"; YES "YES" final String NO = "NO"; NO "NO" final char dream[] = {'d','r','e','a','m'}; dream {'d','r','e','a','m'} 'd' 'r' 'e' 'a' 'm' final char dreamer[] = {'d','r','e','a','m','e','r'}; dreamer {'d','r','e','a','m','e','r'} 'd' 'r' 'e' 'a' 'm' 'e' 'r' final char erase[] = {'e', 'r', 'a', 's', 'e'}; erase {'e', 'r', 'a', 's', 'e'} 'e' 'r' 'a' 's' 'e' final char eraser[] = {'e','r','a','s','e','r'}; eraser {'e','r','a','s','e','r'} 'e' 'r' 'a' 's' 'e' 'r' String s; s try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        } {
            s = reader.readLine();
        } BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in)) BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in)) new BufferedReader(
                new InputStreamReader(System.in)) s = reader.readLine() s reader.readLine() reader.readLine reader PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) boolean flg = false; flg false int tmp = s.length(); tmp s.length() s.length s while (0 < tmp) {
            boolean result = false;

            flg = f(s, tmp, dream);
            result = result | flg;
            if (flg) {
                tmp -= dream.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, dreamer);
            result = result | flg;
            if (flg) {
                tmp -= dreamer.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, erase);
            result = result | flg;
            if (flg) {
                tmp -= erase.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, eraser);
            result = result | flg;
            if (flg) {
                tmp -= eraser.length;
                if (tmp == 0) break;
            }

            if (!result) break;
        } 0 < tmp 0 tmp {
            boolean result = false;

            flg = f(s, tmp, dream);
            result = result | flg;
            if (flg) {
                tmp -= dream.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, dreamer);
            result = result | flg;
            if (flg) {
                tmp -= dreamer.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, erase);
            result = result | flg;
            if (flg) {
                tmp -= erase.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, eraser);
            result = result | flg;
            if (flg) {
                tmp -= eraser.length;
                if (tmp == 0) break;
            }

            if (!result) break;
        } boolean result = false; result false flg = f(s, tmp, dream) flg f(s, tmp, dream) f s tmp dream result = result | flg result result | flg result flg if (flg) {
                tmp -= dream.length;
                if (tmp == 0) break;
            } flg {
                tmp -= dream.length;
                if (tmp == 0) break;
            } tmp -= dream.length tmp dream.length dream dream.length if (tmp == 0) break; tmp == 0 tmp 0 break; flg = f(s, tmp, dreamer) flg f(s, tmp, dreamer) f s tmp dreamer result = result | flg result result | flg result flg if (flg) {
                tmp -= dreamer.length;
                if (tmp == 0) break;
            } flg {
                tmp -= dreamer.length;
                if (tmp == 0) break;
            } tmp -= dreamer.length tmp dreamer.length dreamer dreamer.length if (tmp == 0) break; tmp == 0 tmp 0 break; flg = f(s, tmp, erase) flg f(s, tmp, erase) f s tmp erase result = result | flg result result | flg result flg if (flg) {
                tmp -= erase.length;
                if (tmp == 0) break;
            } flg {
                tmp -= erase.length;
                if (tmp == 0) break;
            } tmp -= erase.length tmp erase.length erase erase.length if (tmp == 0) break; tmp == 0 tmp 0 break; flg = f(s, tmp, eraser) flg f(s, tmp, eraser) f s tmp eraser result = result | flg result result | flg result flg if (flg) {
                tmp -= eraser.length;
                if (tmp == 0) break;
            } flg {
                tmp -= eraser.length;
                if (tmp == 0) break;
            } tmp -= eraser.length tmp eraser.length eraser eraser.length if (tmp == 0) break; tmp == 0 tmp 0 break; if (!result) break; !result result break; out.println(flg ? YES : NO) out.println out flg ? YES : NO flg YES NO out.flush() out.flush out String[] args args public class Main {
    static boolean f(String s, int tmp, char[] a) {
        int start = tmp - a.length;
        int end = tmp;

        boolean flg = true;

        int idx = 0;

        for (int i = start; i < end; i++) {
            if (start < 0) break;
            if (s.charAt(i) != a[idx]) {
                flg = false;
                break;
            }
            idx++;
        }

        return flg;
    }

    public static void main(String[] args) throws IOException {
        final String YES = "YES";
        final String NO = "NO";

        final char dream[] = {'d','r','e','a','m'};
        final char dreamer[] = {'d','r','e','a','m','e','r'};
        final char erase[] = {'e', 'r', 'a', 's', 'e'};
        final char eraser[] = {'e','r','a','s','e','r'};

        String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        PrintWriter out = new PrintWriter(System.out);

        boolean flg = false;

        int tmp = s.length();

        while (0 < tmp) {
            boolean result = false;

            flg = f(s, tmp, dream);
            result = result | flg;
            if (flg) {
                tmp -= dream.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, dreamer);
            result = result | flg;
            if (flg) {
                tmp -= dreamer.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, erase);
            result = result | flg;
            if (flg) {
                tmp -= erase.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, eraser);
            result = result | flg;
            if (flg) {
                tmp -= eraser.length;
                if (tmp == 0) break;
            }

            if (!result) break;
        }

        out.println(flg ? YES : NO);

        out.flush();
    }
} public class Main {
    static boolean f(String s, int tmp, char[] a) {
        int start = tmp - a.length;
        int end = tmp;

        boolean flg = true;

        int idx = 0;

        for (int i = start; i < end; i++) {
            if (start < 0) break;
            if (s.charAt(i) != a[idx]) {
                flg = false;
                break;
            }
            idx++;
        }

        return flg;
    }

    public static void main(String[] args) throws IOException {
        final String YES = "YES";
        final String NO = "NO";

        final char dream[] = {'d','r','e','a','m'};
        final char dreamer[] = {'d','r','e','a','m','e','r'};
        final char erase[] = {'e', 'r', 'a', 's', 'e'};
        final char eraser[] = {'e','r','a','s','e','r'};

        String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        PrintWriter out = new PrintWriter(System.out);

        boolean flg = false;

        int tmp = s.length();

        while (0 < tmp) {
            boolean result = false;

            flg = f(s, tmp, dream);
            result = result | flg;
            if (flg) {
                tmp -= dream.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, dreamer);
            result = result | flg;
            if (flg) {
                tmp -= dreamer.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, erase);
            result = result | flg;
            if (flg) {
                tmp -= erase.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, eraser);
            result = result | flg;
            if (flg) {
                tmp -= eraser.length;
                if (tmp == 0) break;
            }

            if (!result) break;
        }

        out.println(flg ? YES : NO);

        out.flush();
    }
} Main
import java.io.IOException;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import java.io.PrintWriter;

@SuppressWarnings("unchecked")
public class Main {
    static boolean f(String s, int tmp, char[] a) {
        int start = tmp - a.length;
        int end = tmp;

        boolean flg = true;

        int idx = 0;

        for (int i = start; i < end; i++) {
            if (start < 0) break;
            if (s.charAt(i) != a[idx]) {
                flg = false;
                break;
            }
            idx++;
        }

        return flg;
    }

    public static void main(String[] args) throws IOException {
        final String YES = "YES";
        final String NO = "NO";

        final char dream[] = {'d','r','e','a','m'};
        final char dreamer[] = {'d','r','e','a','m','e','r'};
        final char erase[] = {'e', 'r', 'a', 's', 'e'};
        final char eraser[] = {'e','r','a','s','e','r'};

        String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        PrintWriter out = new PrintWriter(System.out);

        boolean flg = false;

        int tmp = s.length();

        while (0 < tmp) {
            boolean result = false;

            flg = f(s, tmp, dream);
            result = result | flg;
            if (flg) {
                tmp -= dream.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, dreamer);
            result = result | flg;
            if (flg) {
                tmp -= dreamer.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, erase);
            result = result | flg;
            if (flg) {
                tmp -= erase.length;
                if (tmp == 0) break;
            }

            flg = f(s, tmp, eraser);
            result = result | flg;
            if (flg) {
                tmp -= eraser.length;
                if (tmp == 0) break;
            }

            if (!result) break;
        }

        out.println(flg ? YES : NO);

        out.flush();
    }
}
