import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.NoSuchElementException;
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;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String str = in.next();
            String dream = "dream";
            String dreamer = "dreamer";
            String erase = "erase";
            String eraser = "eraser";

            str = str.replaceAll(eraser, "");
            str = str.replaceAll(erase, "");
            str = str.replaceAll(dreamer, "");
            str = str.replaceAll(dream, "");

            String ret = str.length() == 0 ? "YES" : "NO";
            out.println(ret);
        }

    }

    static class Scanner {
        private final InputStream in;
        private final byte[] buffer;
        private int ptr;
        private int buflen;

        public Scanner(InputStream in) {
            this.in = in;
            this.buffer = new byte[1024];
            this.ptr = 0;
            this.buflen = 0;
        }

        private boolean hasNextByte() {
            if (ptr < buflen) return true;
            else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) return false;
            }
            return true;
        }

        private byte readByte() {
            if (hasNextByte()) return buffer[ptr++];
            return -1;
        }

        private boolean isPrintableChar(byte c) {
            return '!' <= c && c <= '~';
        }

        private void skipUnprintable() {
            while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
                ptr++;
            }
        }

        public boolean hasNext() {
            skipUnprintable();
            return hasNextByte();
        }

        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            byte b = readByte();
            while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

    }
}
 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.util.NoSuchElementException; NoSuchElementException java.util import java.io.InputStream; InputStream java.io public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String str = in.next();
            String dream = "dream";
            String dreamer = "dreamer";
            String erase = "erase";
            String eraser = "eraser";

            str = str.replaceAll(eraser, "");
            str = str.replaceAll(erase, "");
            str = str.replaceAll(dreamer, "");
            str = str.replaceAll(dream, "");

            String ret = str.length() == 0 ? "YES" : "NO";
            out.println(ret);
        }

    }

    static class Scanner {
        private final InputStream in;
        private final byte[] buffer;
        private int ptr;
        private int buflen;

        public Scanner(InputStream in) {
            this.in = in;
            this.buffer = new byte[1024];
            this.ptr = 0;
            this.buflen = 0;
        }

        private boolean hasNextByte() {
            if (ptr < buflen) return true;
            else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) return false;
            }
            return true;
        }

        private byte readByte() {
            if (hasNextByte()) return buffer[ptr++];
            return -1;
        }

        private boolean isPrintableChar(byte c) {
            return '!' <= c && c <= '~';
        }

        private void skipUnprintable() {
            while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
                ptr++;
            }
        }

        public boolean hasNext() {
            skipUnprintable();
            return hasNextByte();
        }

        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            byte b = readByte();
            while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        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 Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) C solver = new C(); solver new C() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String str = in.next();
            String dream = "dream";
            String dreamer = "dreamer";
            String erase = "erase";
            String eraser = "eraser";

            str = str.replaceAll(eraser, "");
            str = str.replaceAll(erase, "");
            str = str.replaceAll(dreamer, "");
            str = str.replaceAll(dream, "");

            String ret = str.length() == 0 ? "YES" : "NO";
            out.println(ret);
        }

    } C public void solve(int testNumber, Scanner in, PrintWriter out) {
            String str = in.next();
            String dream = "dream";
            String dreamer = "dreamer";
            String erase = "erase";
            String eraser = "eraser";

            str = str.replaceAll(eraser, "");
            str = str.replaceAll(erase, "");
            str = str.replaceAll(dreamer, "");
            str = str.replaceAll(dream, "");

            String ret = str.length() == 0 ? "YES" : "NO";
            out.println(ret);
        } solve {
            String str = in.next();
            String dream = "dream";
            String dreamer = "dreamer";
            String erase = "erase";
            String eraser = "eraser";

            str = str.replaceAll(eraser, "");
            str = str.replaceAll(erase, "");
            str = str.replaceAll(dreamer, "");
            str = str.replaceAll(dream, "");

            String ret = str.length() == 0 ? "YES" : "NO";
            out.println(ret);
        } String str = in.next(); str in.next() in.next in String dream = "dream"; dream "dream" String dreamer = "dreamer"; dreamer "dreamer" String erase = "erase"; erase "erase" String eraser = "eraser"; eraser "eraser" str = str.replaceAll(eraser, "") str str.replaceAll(eraser, "") str.replaceAll str eraser "" str = str.replaceAll(erase, "") str str.replaceAll(erase, "") str.replaceAll str erase "" str = str.replaceAll(dreamer, "") str str.replaceAll(dreamer, "") str.replaceAll str dreamer "" str = str.replaceAll(dream, "") str str.replaceAll(dream, "") str.replaceAll str dream "" String ret = str.length() == 0 ? "YES" : "NO"; ret str.length() == 0 ? "YES" : "NO" str.length() == 0 str.length() str.length str 0 "YES" "NO" out.println(ret) out.println out ret int testNumber testNumber Scanner in in PrintWriter out out static class Scanner {
        private final InputStream in;
        private final byte[] buffer;
        private int ptr;
        private int buflen;

        public Scanner(InputStream in) {
            this.in = in;
            this.buffer = new byte[1024];
            this.ptr = 0;
            this.buflen = 0;
        }

        private boolean hasNextByte() {
            if (ptr < buflen) return true;
            else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) return false;
            }
            return true;
        }

        private byte readByte() {
            if (hasNextByte()) return buffer[ptr++];
            return -1;
        }

        private boolean isPrintableChar(byte c) {
            return '!' <= c && c <= '~';
        }

        private void skipUnprintable() {
            while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
                ptr++;
            }
        }

        public boolean hasNext() {
            skipUnprintable();
            return hasNextByte();
        }

        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            byte b = readByte();
            while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

    } Scanner private final InputStream in; in private final byte[] buffer; buffer private int ptr; ptr private int buflen; buflen public Scanner(InputStream in) {
            this.in = in;
            this.buffer = new byte[1024];
            this.ptr = 0;
            this.buflen = 0;
        } Scanner {
            this.in = in;
            this.buffer = new byte[1024];
            this.ptr = 0;
            this.buflen = 0;
        } this.in = in this.in this this.in in this.buffer = new byte[1024] this.buffer this this.buffer new byte[1024] 1024 this.ptr = 0 this.ptr this this.ptr 0 this.buflen = 0 this.buflen this this.buflen 0 InputStream in in private boolean hasNextByte() {
            if (ptr < buflen) return true;
            else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) return false;
            }
            return true;
        } hasNextByte {
            if (ptr < buflen) return true;
            else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) return false;
            }
            return true;
        } if (ptr < buflen) return true;
            else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) return false;
            } ptr < buflen ptr buflen return true; true {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) return false;
            } ptr = 0 ptr 0 try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                } IOException e {
                    e.printStackTrace();
                } e.printStackTrace() e.printStackTrace e {
                    buflen = in.read(buffer);
                } buflen = in.read(buffer) buflen in.read(buffer) in.read in buffer if (buflen <= 0) return false; buflen <= 0 buflen 0 return false; false return true; true private byte readByte() {
            if (hasNextByte()) return buffer[ptr++];
            return -1;
        } readByte {
            if (hasNextByte()) return buffer[ptr++];
            return -1;
        } if (hasNextByte()) return buffer[ptr++]; hasNextByte() hasNextByte return buffer[ptr++]; buffer[ptr++] buffer ptr++ ptr return -1; -1 1 private boolean isPrintableChar(byte c) {
            return '!' <= c && c <= '~';
        } isPrintableChar {
            return '!' <= c && c <= '~';
        } return '!' <= c && c <= '~'; '!' <= c && c <= '~' '!' <= c '!' c c <= '~' c '~' byte c c private void skipUnprintable() {
            while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
                ptr++;
            }
        } skipUnprintable {
            while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
                ptr++;
            }
        } while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
                ptr++;
            } hasNextByte() && !isPrintableChar(buffer[ptr]) hasNextByte() hasNextByte !isPrintableChar(buffer[ptr]) isPrintableChar(buffer[ptr]) isPrintableChar buffer[ptr] buffer ptr {
                ptr++;
            } ptr++ ptr public boolean hasNext() {
            skipUnprintable();
            return hasNextByte();
        } hasNext {
            skipUnprintable();
            return hasNextByte();
        } skipUnprintable() skipUnprintable return hasNextByte(); hasNextByte() hasNextByte public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            byte b = readByte();
            while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        } next {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            byte b = readByte();
            while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        } if (!hasNext()) throw new NoSuchElementException(); !hasNext() hasNext() hasNext throw new NoSuchElementException(); new NoSuchElementException() StringBuilder sb = new StringBuilder(); sb new StringBuilder() byte b = readByte(); b readByte() readByte while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            } isPrintableChar(b) isPrintableChar b {
                sb.appendCodePoint(b);
                b = readByte();
            } sb.appendCodePoint(b) sb.appendCodePoint sb b b = readByte() b readByte() readByte return sb.toString(); sb.toString() sb.toString sb public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String str = in.next();
            String dream = "dream";
            String dreamer = "dreamer";
            String erase = "erase";
            String eraser = "eraser";

            str = str.replaceAll(eraser, "");
            str = str.replaceAll(erase, "");
            str = str.replaceAll(dreamer, "");
            str = str.replaceAll(dream, "");

            String ret = str.length() == 0 ? "YES" : "NO";
            out.println(ret);
        }

    }

    static class Scanner {
        private final InputStream in;
        private final byte[] buffer;
        private int ptr;
        private int buflen;

        public Scanner(InputStream in) {
            this.in = in;
            this.buffer = new byte[1024];
            this.ptr = 0;
            this.buflen = 0;
        }

        private boolean hasNextByte() {
            if (ptr < buflen) return true;
            else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) return false;
            }
            return true;
        }

        private byte readByte() {
            if (hasNextByte()) return buffer[ptr++];
            return -1;
        }

        private boolean isPrintableChar(byte c) {
            return '!' <= c && c <= '~';
        }

        private void skipUnprintable() {
            while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
                ptr++;
            }
        }

        public boolean hasNext() {
            skipUnprintable();
            return hasNextByte();
        }

        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            byte b = readByte();
            while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

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

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String str = in.next();
            String dream = "dream";
            String dreamer = "dreamer";
            String erase = "erase";
            String eraser = "eraser";

            str = str.replaceAll(eraser, "");
            str = str.replaceAll(erase, "");
            str = str.replaceAll(dreamer, "");
            str = str.replaceAll(dream, "");

            String ret = str.length() == 0 ? "YES" : "NO";
            out.println(ret);
        }

    }

    static class Scanner {
        private final InputStream in;
        private final byte[] buffer;
        private int ptr;
        private int buflen;

        public Scanner(InputStream in) {
            this.in = in;
            this.buffer = new byte[1024];
            this.ptr = 0;
            this.buflen = 0;
        }

        private boolean hasNextByte() {
            if (ptr < buflen) return true;
            else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) return false;
            }
            return true;
        }

        private byte readByte() {
            if (hasNextByte()) return buffer[ptr++];
            return -1;
        }

        private boolean isPrintableChar(byte c) {
            return '!' <= c && c <= '~';
        }

        private void skipUnprintable() {
            while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
                ptr++;
            }
        }

        public boolean hasNext() {
            skipUnprintable();
            return hasNextByte();
        }

        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            byte b = readByte();
            while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.NoSuchElementException;
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;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String str = in.next();
            String dream = "dream";
            String dreamer = "dreamer";
            String erase = "erase";
            String eraser = "eraser";

            str = str.replaceAll(eraser, "");
            str = str.replaceAll(erase, "");
            str = str.replaceAll(dreamer, "");
            str = str.replaceAll(dream, "");

            String ret = str.length() == 0 ? "YES" : "NO";
            out.println(ret);
        }

    }

    static class Scanner {
        private final InputStream in;
        private final byte[] buffer;
        private int ptr;
        private int buflen;

        public Scanner(InputStream in) {
            this.in = in;
            this.buffer = new byte[1024];
            this.ptr = 0;
            this.buflen = 0;
        }

        private boolean hasNextByte() {
            if (ptr < buflen) return true;
            else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) return false;
            }
            return true;
        }

        private byte readByte() {
            if (hasNextByte()) return buffer[ptr++];
            return -1;
        }

        private boolean isPrintableChar(byte c) {
            return '!' <= c && c <= '~';
        }

        private void skipUnprintable() {
            while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
                ptr++;
            }
        }

        public boolean hasNext() {
            skipUnprintable();
            return hasNextByte();
        }

        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            byte b = readByte();
            while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

    }
}

