import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CDaydream solver = new CDaydream();
        solver.solve(1, in, out);
        out.close();
    }

    static class CDaydream {
        public void solve(int testNumber, inputClass sc, PrintWriter out) {
            StringBuilder s = new StringBuilder(sc.nextLine());
            String dream = "dream";
            String dreamer = "dreamer";
            String erase = "erase";
            String eraser = "eraser";
            int n = s.length();
            int i = n - 1;
            while (i >= 0) {
                if (s.charAt(i) == 'r') {
                    int k = 5;
                    boolean ok = true;
                    if (i >= 5) {
                        for (int j = i; j > i - 6; j--) {
                            if (s.charAt(j) == eraser.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 6;
                            continue;
                        }
                    }
                    k = 6;
                    ok = true;
                    if (i >= 6) {
                        for (int j = i; j > i - 7; j--) {
                            if (s.charAt(j) == dreamer.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 7;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                } else {
                    int k = 4;
                    boolean ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == erase.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    k = 4;
                    ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == dream.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                }
            }
            out.println("YES");
        }

    }

    static class inputClass {
        BufferedReader br;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.io.IOException; IOException java.io import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.InputStream; InputStream java.io public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CDaydream solver = new CDaydream();
        solver.solve(1, in, out);
        out.close();
    }

    static class CDaydream {
        public void solve(int testNumber, inputClass sc, PrintWriter out) {
            StringBuilder s = new StringBuilder(sc.nextLine());
            String dream = "dream";
            String dreamer = "dreamer";
            String erase = "erase";
            String eraser = "eraser";
            int n = s.length();
            int i = n - 1;
            while (i >= 0) {
                if (s.charAt(i) == 'r') {
                    int k = 5;
                    boolean ok = true;
                    if (i >= 5) {
                        for (int j = i; j > i - 6; j--) {
                            if (s.charAt(j) == eraser.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 6;
                            continue;
                        }
                    }
                    k = 6;
                    ok = true;
                    if (i >= 6) {
                        for (int j = i; j > i - 7; j--) {
                            if (s.charAt(j) == dreamer.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 7;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                } else {
                    int k = 4;
                    boolean ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == erase.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    k = 4;
                    ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == dream.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                }
            }
            out.println("YES");
        }

    }

    static class inputClass {
        BufferedReader br;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CDaydream solver = new CDaydream();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CDaydream solver = new CDaydream();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out inputClass in = new inputClass(inputStream); in new inputClass(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) CDaydream solver = new CDaydream(); solver new CDaydream() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class CDaydream {
        public void solve(int testNumber, inputClass sc, PrintWriter out) {
            StringBuilder s = new StringBuilder(sc.nextLine());
            String dream = "dream";
            String dreamer = "dreamer";
            String erase = "erase";
            String eraser = "eraser";
            int n = s.length();
            int i = n - 1;
            while (i >= 0) {
                if (s.charAt(i) == 'r') {
                    int k = 5;
                    boolean ok = true;
                    if (i >= 5) {
                        for (int j = i; j > i - 6; j--) {
                            if (s.charAt(j) == eraser.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 6;
                            continue;
                        }
                    }
                    k = 6;
                    ok = true;
                    if (i >= 6) {
                        for (int j = i; j > i - 7; j--) {
                            if (s.charAt(j) == dreamer.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 7;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                } else {
                    int k = 4;
                    boolean ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == erase.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    k = 4;
                    ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == dream.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                }
            }
            out.println("YES");
        }

    } CDaydream public void solve(int testNumber, inputClass sc, PrintWriter out) {
            StringBuilder s = new StringBuilder(sc.nextLine());
            String dream = "dream";
            String dreamer = "dreamer";
            String erase = "erase";
            String eraser = "eraser";
            int n = s.length();
            int i = n - 1;
            while (i >= 0) {
                if (s.charAt(i) == 'r') {
                    int k = 5;
                    boolean ok = true;
                    if (i >= 5) {
                        for (int j = i; j > i - 6; j--) {
                            if (s.charAt(j) == eraser.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 6;
                            continue;
                        }
                    }
                    k = 6;
                    ok = true;
                    if (i >= 6) {
                        for (int j = i; j > i - 7; j--) {
                            if (s.charAt(j) == dreamer.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 7;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                } else {
                    int k = 4;
                    boolean ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == erase.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    k = 4;
                    ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == dream.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                }
            }
            out.println("YES");
        } solve {
            StringBuilder s = new StringBuilder(sc.nextLine());
            String dream = "dream";
            String dreamer = "dreamer";
            String erase = "erase";
            String eraser = "eraser";
            int n = s.length();
            int i = n - 1;
            while (i >= 0) {
                if (s.charAt(i) == 'r') {
                    int k = 5;
                    boolean ok = true;
                    if (i >= 5) {
                        for (int j = i; j > i - 6; j--) {
                            if (s.charAt(j) == eraser.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 6;
                            continue;
                        }
                    }
                    k = 6;
                    ok = true;
                    if (i >= 6) {
                        for (int j = i; j > i - 7; j--) {
                            if (s.charAt(j) == dreamer.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 7;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                } else {
                    int k = 4;
                    boolean ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == erase.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    k = 4;
                    ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == dream.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                }
            }
            out.println("YES");
        } StringBuilder s = new StringBuilder(sc.nextLine()); s new StringBuilder(sc.nextLine()) String dream = "dream"; dream "dream" String dreamer = "dreamer"; dreamer "dreamer" String erase = "erase"; erase "erase" String eraser = "eraser"; eraser "eraser" int n = s.length(); n s.length() s.length s int i = n - 1; i n - 1 n 1 while (i >= 0) {
                if (s.charAt(i) == 'r') {
                    int k = 5;
                    boolean ok = true;
                    if (i >= 5) {
                        for (int j = i; j > i - 6; j--) {
                            if (s.charAt(j) == eraser.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 6;
                            continue;
                        }
                    }
                    k = 6;
                    ok = true;
                    if (i >= 6) {
                        for (int j = i; j > i - 7; j--) {
                            if (s.charAt(j) == dreamer.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 7;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                } else {
                    int k = 4;
                    boolean ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == erase.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    k = 4;
                    ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == dream.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                }
            } i >= 0 i 0 {
                if (s.charAt(i) == 'r') {
                    int k = 5;
                    boolean ok = true;
                    if (i >= 5) {
                        for (int j = i; j > i - 6; j--) {
                            if (s.charAt(j) == eraser.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 6;
                            continue;
                        }
                    }
                    k = 6;
                    ok = true;
                    if (i >= 6) {
                        for (int j = i; j > i - 7; j--) {
                            if (s.charAt(j) == dreamer.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 7;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                } else {
                    int k = 4;
                    boolean ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == erase.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    k = 4;
                    ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == dream.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                }
            } if (s.charAt(i) == 'r') {
                    int k = 5;
                    boolean ok = true;
                    if (i >= 5) {
                        for (int j = i; j > i - 6; j--) {
                            if (s.charAt(j) == eraser.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 6;
                            continue;
                        }
                    }
                    k = 6;
                    ok = true;
                    if (i >= 6) {
                        for (int j = i; j > i - 7; j--) {
                            if (s.charAt(j) == dreamer.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 7;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                } else {
                    int k = 4;
                    boolean ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == erase.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    k = 4;
                    ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == dream.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                } s.charAt(i) == 'r' s.charAt(i) s.charAt s i 'r' {
                    int k = 5;
                    boolean ok = true;
                    if (i >= 5) {
                        for (int j = i; j > i - 6; j--) {
                            if (s.charAt(j) == eraser.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 6;
                            continue;
                        }
                    }
                    k = 6;
                    ok = true;
                    if (i >= 6) {
                        for (int j = i; j > i - 7; j--) {
                            if (s.charAt(j) == dreamer.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 7;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                } int k = 5; k 5 boolean ok = true; ok true if (i >= 5) {
                        for (int j = i; j > i - 6; j--) {
                            if (s.charAt(j) == eraser.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 6;
                            continue;
                        }
                    } i >= 5 i 5 {
                        for (int j = i; j > i - 6; j--) {
                            if (s.charAt(j) == eraser.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 6;
                            continue;
                        }
                    } for (int j = i; j > i - 6; j--) {
                            if (s.charAt(j) == eraser.charAt(k))
                                k--;
                            else
                                ok = false;
                        } int j = i; int j = i; j i j > i - 6 j i - 6 i 6 j-- j-- j {
                            if (s.charAt(j) == eraser.charAt(k))
                                k--;
                            else
                                ok = false;
                        } {
                            if (s.charAt(j) == eraser.charAt(k))
                                k--;
                            else
                                ok = false;
                        } if (s.charAt(j) == eraser.charAt(k))
                                k--;
                            else
                                ok = false; s.charAt(j) == eraser.charAt(k) s.charAt(j) s.charAt s j eraser.charAt(k) eraser.charAt eraser k k-- k ok = false ok false if (ok) {
                            i = i - 6;
                            continue;
                        } ok {
                            i = i - 6;
                            continue;
                        } i = i - 6 i i - 6 i 6 continue; k = 6 k 6 ok = true ok true if (i >= 6) {
                        for (int j = i; j > i - 7; j--) {
                            if (s.charAt(j) == dreamer.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 7;
                            continue;
                        }
                    } i >= 6 i 6 {
                        for (int j = i; j > i - 7; j--) {
                            if (s.charAt(j) == dreamer.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 7;
                            continue;
                        }
                    } for (int j = i; j > i - 7; j--) {
                            if (s.charAt(j) == dreamer.charAt(k))
                                k--;
                            else
                                ok = false;
                        } int j = i; int j = i; j i j > i - 7 j i - 7 i 7 j-- j-- j {
                            if (s.charAt(j) == dreamer.charAt(k))
                                k--;
                            else
                                ok = false;
                        } {
                            if (s.charAt(j) == dreamer.charAt(k))
                                k--;
                            else
                                ok = false;
                        } if (s.charAt(j) == dreamer.charAt(k))
                                k--;
                            else
                                ok = false; s.charAt(j) == dreamer.charAt(k) s.charAt(j) s.charAt s j dreamer.charAt(k) dreamer.charAt dreamer k k-- k ok = false ok false if (ok) {
                            i = i - 7;
                            continue;
                        } ok {
                            i = i - 7;
                            continue;
                        } i = i - 7 i i - 7 i 7 continue; out.println("NO") out.println out "NO" return; {
                    int k = 4;
                    boolean ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == erase.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    k = 4;
                    ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == dream.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                } int k = 4; k 4 boolean ok = true; ok true if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == erase.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    } i >= 4 i 4 {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == erase.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    } for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == erase.charAt(k))
                                k--;
                            else
                                ok = false;
                        } int j = i; int j = i; j i j > i - 5 j i - 5 i 5 j-- j-- j {
                            if (s.charAt(j) == erase.charAt(k))
                                k--;
                            else
                                ok = false;
                        } {
                            if (s.charAt(j) == erase.charAt(k))
                                k--;
                            else
                                ok = false;
                        } if (s.charAt(j) == erase.charAt(k))
                                k--;
                            else
                                ok = false; s.charAt(j) == erase.charAt(k) s.charAt(j) s.charAt s j erase.charAt(k) erase.charAt erase k k-- k ok = false ok false if (ok) {
                            i = i - 5;
                            continue;
                        } ok {
                            i = i - 5;
                            continue;
                        } i = i - 5 i i - 5 i 5 continue; k = 4 k 4 ok = true ok true if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == dream.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    } i >= 4 i 4 {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == dream.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    } for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == dream.charAt(k))
                                k--;
                            else
                                ok = false;
                        } int j = i; int j = i; j i j > i - 5 j i - 5 i 5 j-- j-- j {
                            if (s.charAt(j) == dream.charAt(k))
                                k--;
                            else
                                ok = false;
                        } {
                            if (s.charAt(j) == dream.charAt(k))
                                k--;
                            else
                                ok = false;
                        } if (s.charAt(j) == dream.charAt(k))
                                k--;
                            else
                                ok = false; s.charAt(j) == dream.charAt(k) s.charAt(j) s.charAt s j dream.charAt(k) dream.charAt dream k k-- k ok = false ok false if (ok) {
                            i = i - 5;
                            continue;
                        } ok {
                            i = i - 5;
                            continue;
                        } i = i - 5 i i - 5 i 5 continue; out.println("NO") out.println out "NO" return; out.println("YES") out.println out "YES" int testNumber testNumber inputClass sc sc PrintWriter out out static class inputClass {
        BufferedReader br;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    } inputClass BufferedReader br; br public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        } inputClass {

            br = new BufferedReader(new InputStreamReader(in));
        } br = new BufferedReader(new InputStreamReader(in)) br new BufferedReader(new InputStreamReader(in)) InputStream in in public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        } nextLine {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        } String str = ""; str "" try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } IOException e {
                e.printStackTrace();
            } e.printStackTrace() e.printStackTrace e {
                str = br.readLine();
            } str = br.readLine() str br.readLine() br.readLine br return str; str public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CDaydream solver = new CDaydream();
        solver.solve(1, in, out);
        out.close();
    }

    static class CDaydream {
        public void solve(int testNumber, inputClass sc, PrintWriter out) {
            StringBuilder s = new StringBuilder(sc.nextLine());
            String dream = "dream";
            String dreamer = "dreamer";
            String erase = "erase";
            String eraser = "eraser";
            int n = s.length();
            int i = n - 1;
            while (i >= 0) {
                if (s.charAt(i) == 'r') {
                    int k = 5;
                    boolean ok = true;
                    if (i >= 5) {
                        for (int j = i; j > i - 6; j--) {
                            if (s.charAt(j) == eraser.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 6;
                            continue;
                        }
                    }
                    k = 6;
                    ok = true;
                    if (i >= 6) {
                        for (int j = i; j > i - 7; j--) {
                            if (s.charAt(j) == dreamer.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 7;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                } else {
                    int k = 4;
                    boolean ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == erase.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    k = 4;
                    ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == dream.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                }
            }
            out.println("YES");
        }

    }

    static class inputClass {
        BufferedReader br;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CDaydream solver = new CDaydream();
        solver.solve(1, in, out);
        out.close();
    }

    static class CDaydream {
        public void solve(int testNumber, inputClass sc, PrintWriter out) {
            StringBuilder s = new StringBuilder(sc.nextLine());
            String dream = "dream";
            String dreamer = "dreamer";
            String erase = "erase";
            String eraser = "eraser";
            int n = s.length();
            int i = n - 1;
            while (i >= 0) {
                if (s.charAt(i) == 'r') {
                    int k = 5;
                    boolean ok = true;
                    if (i >= 5) {
                        for (int j = i; j > i - 6; j--) {
                            if (s.charAt(j) == eraser.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 6;
                            continue;
                        }
                    }
                    k = 6;
                    ok = true;
                    if (i >= 6) {
                        for (int j = i; j > i - 7; j--) {
                            if (s.charAt(j) == dreamer.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 7;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                } else {
                    int k = 4;
                    boolean ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == erase.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    k = 4;
                    ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == dream.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                }
            }
            out.println("YES");
        }

    }

    static class inputClass {
        BufferedReader br;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CDaydream solver = new CDaydream();
        solver.solve(1, in, out);
        out.close();
    }

    static class CDaydream {
        public void solve(int testNumber, inputClass sc, PrintWriter out) {
            StringBuilder s = new StringBuilder(sc.nextLine());
            String dream = "dream";
            String dreamer = "dreamer";
            String erase = "erase";
            String eraser = "eraser";
            int n = s.length();
            int i = n - 1;
            while (i >= 0) {
                if (s.charAt(i) == 'r') {
                    int k = 5;
                    boolean ok = true;
                    if (i >= 5) {
                        for (int j = i; j > i - 6; j--) {
                            if (s.charAt(j) == eraser.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 6;
                            continue;
                        }
                    }
                    k = 6;
                    ok = true;
                    if (i >= 6) {
                        for (int j = i; j > i - 7; j--) {
                            if (s.charAt(j) == dreamer.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 7;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                } else {
                    int k = 4;
                    boolean ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == erase.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    k = 4;
                    ok = true;
                    if (i >= 4) {
                        for (int j = i; j > i - 5; j--) {
                            if (s.charAt(j) == dream.charAt(k))
                                k--;
                            else
                                ok = false;
                        }
                        if (ok) {
                            i = i - 5;
                            continue;
                        }
                    }
                    out.println("NO");
                    return;
                }
            }
            out.println("YES");
        }

    }

    static class inputClass {
        BufferedReader br;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
}

