import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * 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) {
            if (solve(in.next())) {
                out.println("YES");
            } else {
                out.println("NO");
            }
        }

        public boolean solve(String input) {
            String word = input + "$";

            int totalStates = 5;
            int[] statePos = new int[totalStates];
            boolean[] activeStates = new boolean[totalStates];
            activeStates[0] = true;
            boolean atLeastOnActiveState = true;
            while (atLeastOnActiveState) {

                atLeastOnActiveState = false;
                boolean[] newStates = new boolean[totalStates];
                for (int stateId = 0; stateId < totalStates - 1; stateId++) {
                    if (activeStates[stateId]) {
                        atLeastOnActiveState = true;
                        processState(stateId, statePos, newStates, word);
                    }
                }

                if (newStates[4]) {
                    return true;
                }

                activeStates = newStates;
            }

            return false;
        }

        private void processState(int stateId, int[] statePos, boolean[] newStates, String word) {
            int startIdx = statePos[stateId];
            int nextStatePos = 0;
            switch (stateId) {
                case 0:
                    if ((nextStatePos = matchString(word, "dream", startIdx)) > 0) {
                        newStates[1] = true;
                        statePos[1] = nextStatePos;
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    }
                    break;
                case 1:
                    if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;

                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    }
                    break;
                case 2:
                    if ((nextStatePos = matchString(word, "as", startIdx)) > 0) {
                        newStates[3] = true;
                        statePos[3] = nextStatePos;
                    }
                    break;
                case 3:
                    if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "e", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    }
                    break;
            }
        }

        private int matchString(String word, String target, int startIdx) {
            if (startIdx + target.length() > word.length()) {
                return -1;
            }

            for (int i = 0; i < target.length(); i++) {
                if (word.charAt(startIdx + i) != target.charAt(i)) {
                    return -1;
                }
            }

            return startIdx + target.length();
        }

    }
}
 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.util.Scanner; Scanner java.util 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) {
            if (solve(in.next())) {
                out.println("YES");
            } else {
                out.println("NO");
            }
        }

        public boolean solve(String input) {
            String word = input + "$";

            int totalStates = 5;
            int[] statePos = new int[totalStates];
            boolean[] activeStates = new boolean[totalStates];
            activeStates[0] = true;
            boolean atLeastOnActiveState = true;
            while (atLeastOnActiveState) {

                atLeastOnActiveState = false;
                boolean[] newStates = new boolean[totalStates];
                for (int stateId = 0; stateId < totalStates - 1; stateId++) {
                    if (activeStates[stateId]) {
                        atLeastOnActiveState = true;
                        processState(stateId, statePos, newStates, word);
                    }
                }

                if (newStates[4]) {
                    return true;
                }

                activeStates = newStates;
            }

            return false;
        }

        private void processState(int stateId, int[] statePos, boolean[] newStates, String word) {
            int startIdx = statePos[stateId];
            int nextStatePos = 0;
            switch (stateId) {
                case 0:
                    if ((nextStatePos = matchString(word, "dream", startIdx)) > 0) {
                        newStates[1] = true;
                        statePos[1] = nextStatePos;
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    }
                    break;
                case 1:
                    if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;

                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    }
                    break;
                case 2:
                    if ((nextStatePos = matchString(word, "as", startIdx)) > 0) {
                        newStates[3] = true;
                        statePos[3] = nextStatePos;
                    }
                    break;
                case 3:
                    if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "e", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    }
                    break;
            }
        }

        private int matchString(String word, String target, int startIdx) {
            if (startIdx + target.length() > word.length()) {
                return -1;
            }

            for (int i = 0; i < target.length(); i++) {
                if (word.charAt(startIdx + i) != target.charAt(i)) {
                    return -1;
                }
            }

            return startIdx + target.length();
        }

    }
} 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) {
            if (solve(in.next())) {
                out.println("YES");
            } else {
                out.println("NO");
            }
        }

        public boolean solve(String input) {
            String word = input + "$";

            int totalStates = 5;
            int[] statePos = new int[totalStates];
            boolean[] activeStates = new boolean[totalStates];
            activeStates[0] = true;
            boolean atLeastOnActiveState = true;
            while (atLeastOnActiveState) {

                atLeastOnActiveState = false;
                boolean[] newStates = new boolean[totalStates];
                for (int stateId = 0; stateId < totalStates - 1; stateId++) {
                    if (activeStates[stateId]) {
                        atLeastOnActiveState = true;
                        processState(stateId, statePos, newStates, word);
                    }
                }

                if (newStates[4]) {
                    return true;
                }

                activeStates = newStates;
            }

            return false;
        }

        private void processState(int stateId, int[] statePos, boolean[] newStates, String word) {
            int startIdx = statePos[stateId];
            int nextStatePos = 0;
            switch (stateId) {
                case 0:
                    if ((nextStatePos = matchString(word, "dream", startIdx)) > 0) {
                        newStates[1] = true;
                        statePos[1] = nextStatePos;
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    }
                    break;
                case 1:
                    if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;

                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    }
                    break;
                case 2:
                    if ((nextStatePos = matchString(word, "as", startIdx)) > 0) {
                        newStates[3] = true;
                        statePos[3] = nextStatePos;
                    }
                    break;
                case 3:
                    if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "e", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    }
                    break;
            }
        }

        private int matchString(String word, String target, int startIdx) {
            if (startIdx + target.length() > word.length()) {
                return -1;
            }

            for (int i = 0; i < target.length(); i++) {
                if (word.charAt(startIdx + i) != target.charAt(i)) {
                    return -1;
                }
            }

            return startIdx + target.length();
        }

    } C public void solve(int testNumber, Scanner in, PrintWriter out) {
            if (solve(in.next())) {
                out.println("YES");
            } else {
                out.println("NO");
            }
        } solve {
            if (solve(in.next())) {
                out.println("YES");
            } else {
                out.println("NO");
            }
        } if (solve(in.next())) {
                out.println("YES");
            } else {
                out.println("NO");
            } solve(in.next()) solve in.next() in.next in {
                out.println("YES");
            } out.println("YES") out.println out "YES" {
                out.println("NO");
            } out.println("NO") out.println out "NO" int testNumber testNumber Scanner in in PrintWriter out out public boolean solve(String input) {
            String word = input + "$";

            int totalStates = 5;
            int[] statePos = new int[totalStates];
            boolean[] activeStates = new boolean[totalStates];
            activeStates[0] = true;
            boolean atLeastOnActiveState = true;
            while (atLeastOnActiveState) {

                atLeastOnActiveState = false;
                boolean[] newStates = new boolean[totalStates];
                for (int stateId = 0; stateId < totalStates - 1; stateId++) {
                    if (activeStates[stateId]) {
                        atLeastOnActiveState = true;
                        processState(stateId, statePos, newStates, word);
                    }
                }

                if (newStates[4]) {
                    return true;
                }

                activeStates = newStates;
            }

            return false;
        } solve {
            String word = input + "$";

            int totalStates = 5;
            int[] statePos = new int[totalStates];
            boolean[] activeStates = new boolean[totalStates];
            activeStates[0] = true;
            boolean atLeastOnActiveState = true;
            while (atLeastOnActiveState) {

                atLeastOnActiveState = false;
                boolean[] newStates = new boolean[totalStates];
                for (int stateId = 0; stateId < totalStates - 1; stateId++) {
                    if (activeStates[stateId]) {
                        atLeastOnActiveState = true;
                        processState(stateId, statePos, newStates, word);
                    }
                }

                if (newStates[4]) {
                    return true;
                }

                activeStates = newStates;
            }

            return false;
        } String word = input + "$"; word input + "$" input "$" int totalStates = 5; totalStates 5 int[] statePos = new int[totalStates]; statePos new int[totalStates] totalStates boolean[] activeStates = new boolean[totalStates]; activeStates new boolean[totalStates] totalStates activeStates[0] = true activeStates[0] activeStates 0 true boolean atLeastOnActiveState = true; atLeastOnActiveState true while (atLeastOnActiveState) {

                atLeastOnActiveState = false;
                boolean[] newStates = new boolean[totalStates];
                for (int stateId = 0; stateId < totalStates - 1; stateId++) {
                    if (activeStates[stateId]) {
                        atLeastOnActiveState = true;
                        processState(stateId, statePos, newStates, word);
                    }
                }

                if (newStates[4]) {
                    return true;
                }

                activeStates = newStates;
            } atLeastOnActiveState {

                atLeastOnActiveState = false;
                boolean[] newStates = new boolean[totalStates];
                for (int stateId = 0; stateId < totalStates - 1; stateId++) {
                    if (activeStates[stateId]) {
                        atLeastOnActiveState = true;
                        processState(stateId, statePos, newStates, word);
                    }
                }

                if (newStates[4]) {
                    return true;
                }

                activeStates = newStates;
            } atLeastOnActiveState = false atLeastOnActiveState false boolean[] newStates = new boolean[totalStates]; newStates new boolean[totalStates] totalStates for (int stateId = 0; stateId < totalStates - 1; stateId++) {
                    if (activeStates[stateId]) {
                        atLeastOnActiveState = true;
                        processState(stateId, statePos, newStates, word);
                    }
                } int stateId = 0; int stateId = 0; stateId 0 stateId < totalStates - 1 stateId totalStates - 1 totalStates 1 stateId++ stateId++ stateId {
                    if (activeStates[stateId]) {
                        atLeastOnActiveState = true;
                        processState(stateId, statePos, newStates, word);
                    }
                } {
                    if (activeStates[stateId]) {
                        atLeastOnActiveState = true;
                        processState(stateId, statePos, newStates, word);
                    }
                } if (activeStates[stateId]) {
                        atLeastOnActiveState = true;
                        processState(stateId, statePos, newStates, word);
                    } activeStates[stateId] activeStates stateId {
                        atLeastOnActiveState = true;
                        processState(stateId, statePos, newStates, word);
                    } atLeastOnActiveState = true atLeastOnActiveState true processState(stateId, statePos, newStates, word) processState stateId statePos newStates word if (newStates[4]) {
                    return true;
                } newStates[4] newStates 4 {
                    return true;
                } return true; true activeStates = newStates activeStates newStates return false; false String input input private void processState(int stateId, int[] statePos, boolean[] newStates, String word) {
            int startIdx = statePos[stateId];
            int nextStatePos = 0;
            switch (stateId) {
                case 0:
                    if ((nextStatePos = matchString(word, "dream", startIdx)) > 0) {
                        newStates[1] = true;
                        statePos[1] = nextStatePos;
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    }
                    break;
                case 1:
                    if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;

                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    }
                    break;
                case 2:
                    if ((nextStatePos = matchString(word, "as", startIdx)) > 0) {
                        newStates[3] = true;
                        statePos[3] = nextStatePos;
                    }
                    break;
                case 3:
                    if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "e", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    }
                    break;
            }
        } processState {
            int startIdx = statePos[stateId];
            int nextStatePos = 0;
            switch (stateId) {
                case 0:
                    if ((nextStatePos = matchString(word, "dream", startIdx)) > 0) {
                        newStates[1] = true;
                        statePos[1] = nextStatePos;
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    }
                    break;
                case 1:
                    if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;

                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    }
                    break;
                case 2:
                    if ((nextStatePos = matchString(word, "as", startIdx)) > 0) {
                        newStates[3] = true;
                        statePos[3] = nextStatePos;
                    }
                    break;
                case 3:
                    if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "e", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    }
                    break;
            }
        } int startIdx = statePos[stateId]; startIdx statePos[stateId] statePos stateId int nextStatePos = 0; nextStatePos 0 switch (stateId) {
                case 0:
                    if ((nextStatePos = matchString(word, "dream", startIdx)) > 0) {
                        newStates[1] = true;
                        statePos[1] = nextStatePos;
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    }
                    break;
                case 1:
                    if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;

                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    }
                    break;
                case 2:
                    if ((nextStatePos = matchString(word, "as", startIdx)) > 0) {
                        newStates[3] = true;
                        statePos[3] = nextStatePos;
                    }
                    break;
                case 3:
                    if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "e", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    }
                    break;
            } stateId case 0: 0 case 0: if ((nextStatePos = matchString(word, "dream", startIdx)) > 0) {
                        newStates[1] = true;
                        statePos[1] = nextStatePos;
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    } (nextStatePos = matchString(word, "dream", startIdx)) > 0 (nextStatePos = matchString(word, "dream", startIdx)) nextStatePos matchString(word, "dream", startIdx) matchString word "dream" startIdx 0 {
                        newStates[1] = true;
                        statePos[1] = nextStatePos;
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } newStates[1] = true newStates[1] newStates 1 true statePos[1] = nextStatePos statePos[1] statePos 1 nextStatePos newStates[0] = true newStates[0] newStates 0 true statePos[0] = nextStatePos statePos[0] statePos 0 nextStatePos if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    } (nextStatePos = matchString(word, "er", startIdx)) > 0 (nextStatePos = matchString(word, "er", startIdx)) nextStatePos matchString(word, "er", startIdx) matchString word "er" startIdx 0 {
                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } newStates[2] = true newStates[2] newStates 2 true statePos[2] = nextStatePos statePos[2] statePos 2 nextStatePos if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    } (nextStatePos = matchString(word, "$", startIdx)) > 0 (nextStatePos = matchString(word, "$", startIdx)) nextStatePos matchString(word, "$", startIdx) matchString word "$" startIdx 0 {
                        newStates[4] = true;
                    } newStates[4] = true newStates[4] newStates 4 true break; case 1: 1 case 1: if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;

                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    } (nextStatePos = matchString(word, "er", startIdx)) > 0 (nextStatePos = matchString(word, "er", startIdx)) nextStatePos matchString(word, "er", startIdx) matchString word "er" startIdx 0 {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;

                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } newStates[0] = true newStates[0] newStates 0 true statePos[0] = nextStatePos statePos[0] statePos 0 nextStatePos newStates[2] = true newStates[2] newStates 2 true statePos[2] = nextStatePos statePos[2] statePos 2 nextStatePos if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    } (nextStatePos = matchString(word, "$", startIdx)) > 0 (nextStatePos = matchString(word, "$", startIdx)) nextStatePos matchString(word, "$", startIdx) matchString word "$" startIdx 0 {
                        newStates[4] = true;
                    } newStates[4] = true newStates[4] newStates 4 true break; case 2: 2 case 2: if ((nextStatePos = matchString(word, "as", startIdx)) > 0) {
                        newStates[3] = true;
                        statePos[3] = nextStatePos;
                    } (nextStatePos = matchString(word, "as", startIdx)) > 0 (nextStatePos = matchString(word, "as", startIdx)) nextStatePos matchString(word, "as", startIdx) matchString word "as" startIdx 0 {
                        newStates[3] = true;
                        statePos[3] = nextStatePos;
                    } newStates[3] = true newStates[3] newStates 3 true statePos[3] = nextStatePos statePos[3] statePos 3 nextStatePos break; case 3: 3 case 3: if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "e", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } (nextStatePos = matchString(word, "er", startIdx)) > 0 (nextStatePos = matchString(word, "er", startIdx)) nextStatePos matchString(word, "er", startIdx) matchString word "er" startIdx 0 {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } newStates[0] = true newStates[0] newStates 0 true statePos[0] = nextStatePos statePos[0] statePos 0 nextStatePos if ((nextStatePos = matchString(word, "e", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } (nextStatePos = matchString(word, "e", startIdx)) > 0 (nextStatePos = matchString(word, "e", startIdx)) nextStatePos matchString(word, "e", startIdx) matchString word "e" startIdx 0 {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } newStates[0] = true newStates[0] newStates 0 true statePos[0] = nextStatePos statePos[0] statePos 0 nextStatePos break; int stateId stateId int[] statePos statePos boolean[] newStates newStates String word word private int matchString(String word, String target, int startIdx) {
            if (startIdx + target.length() > word.length()) {
                return -1;
            }

            for (int i = 0; i < target.length(); i++) {
                if (word.charAt(startIdx + i) != target.charAt(i)) {
                    return -1;
                }
            }

            return startIdx + target.length();
        } matchString {
            if (startIdx + target.length() > word.length()) {
                return -1;
            }

            for (int i = 0; i < target.length(); i++) {
                if (word.charAt(startIdx + i) != target.charAt(i)) {
                    return -1;
                }
            }

            return startIdx + target.length();
        } if (startIdx + target.length() > word.length()) {
                return -1;
            } startIdx + target.length() > word.length() startIdx + target.length() startIdx target.length() target.length target word.length() word.length word {
                return -1;
            } return -1; -1 1 for (int i = 0; i < target.length(); i++) {
                if (word.charAt(startIdx + i) != target.charAt(i)) {
                    return -1;
                }
            } int i = 0; int i = 0; i 0 i < target.length() i target.length() target.length target i++ i++ i {
                if (word.charAt(startIdx + i) != target.charAt(i)) {
                    return -1;
                }
            } {
                if (word.charAt(startIdx + i) != target.charAt(i)) {
                    return -1;
                }
            } if (word.charAt(startIdx + i) != target.charAt(i)) {
                    return -1;
                } word.charAt(startIdx + i) != target.charAt(i) word.charAt(startIdx + i) word.charAt word startIdx + i startIdx i target.charAt(i) target.charAt target i {
                    return -1;
                } return -1; -1 1 return startIdx + target.length(); startIdx + target.length() startIdx target.length() target.length target String word word String target target int startIdx startIdx 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) {
            if (solve(in.next())) {
                out.println("YES");
            } else {
                out.println("NO");
            }
        }

        public boolean solve(String input) {
            String word = input + "$";

            int totalStates = 5;
            int[] statePos = new int[totalStates];
            boolean[] activeStates = new boolean[totalStates];
            activeStates[0] = true;
            boolean atLeastOnActiveState = true;
            while (atLeastOnActiveState) {

                atLeastOnActiveState = false;
                boolean[] newStates = new boolean[totalStates];
                for (int stateId = 0; stateId < totalStates - 1; stateId++) {
                    if (activeStates[stateId]) {
                        atLeastOnActiveState = true;
                        processState(stateId, statePos, newStates, word);
                    }
                }

                if (newStates[4]) {
                    return true;
                }

                activeStates = newStates;
            }

            return false;
        }

        private void processState(int stateId, int[] statePos, boolean[] newStates, String word) {
            int startIdx = statePos[stateId];
            int nextStatePos = 0;
            switch (stateId) {
                case 0:
                    if ((nextStatePos = matchString(word, "dream", startIdx)) > 0) {
                        newStates[1] = true;
                        statePos[1] = nextStatePos;
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    }
                    break;
                case 1:
                    if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;

                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    }
                    break;
                case 2:
                    if ((nextStatePos = matchString(word, "as", startIdx)) > 0) {
                        newStates[3] = true;
                        statePos[3] = nextStatePos;
                    }
                    break;
                case 3:
                    if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "e", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    }
                    break;
            }
        }

        private int matchString(String word, String target, int startIdx) {
            if (startIdx + target.length() > word.length()) {
                return -1;
            }

            for (int i = 0; i < target.length(); i++) {
                if (word.charAt(startIdx + i) != target.charAt(i)) {
                    return -1;
                }
            }

            return startIdx + target.length();
        }

    }
} 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) {
            if (solve(in.next())) {
                out.println("YES");
            } else {
                out.println("NO");
            }
        }

        public boolean solve(String input) {
            String word = input + "$";

            int totalStates = 5;
            int[] statePos = new int[totalStates];
            boolean[] activeStates = new boolean[totalStates];
            activeStates[0] = true;
            boolean atLeastOnActiveState = true;
            while (atLeastOnActiveState) {

                atLeastOnActiveState = false;
                boolean[] newStates = new boolean[totalStates];
                for (int stateId = 0; stateId < totalStates - 1; stateId++) {
                    if (activeStates[stateId]) {
                        atLeastOnActiveState = true;
                        processState(stateId, statePos, newStates, word);
                    }
                }

                if (newStates[4]) {
                    return true;
                }

                activeStates = newStates;
            }

            return false;
        }

        private void processState(int stateId, int[] statePos, boolean[] newStates, String word) {
            int startIdx = statePos[stateId];
            int nextStatePos = 0;
            switch (stateId) {
                case 0:
                    if ((nextStatePos = matchString(word, "dream", startIdx)) > 0) {
                        newStates[1] = true;
                        statePos[1] = nextStatePos;
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    }
                    break;
                case 1:
                    if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;

                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    }
                    break;
                case 2:
                    if ((nextStatePos = matchString(word, "as", startIdx)) > 0) {
                        newStates[3] = true;
                        statePos[3] = nextStatePos;
                    }
                    break;
                case 3:
                    if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "e", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    }
                    break;
            }
        }

        private int matchString(String word, String target, int startIdx) {
            if (startIdx + target.length() > word.length()) {
                return -1;
            }

            for (int i = 0; i < target.length(); i++) {
                if (word.charAt(startIdx + i) != target.charAt(i)) {
                    return -1;
                }
            }

            return startIdx + target.length();
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * 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) {
            if (solve(in.next())) {
                out.println("YES");
            } else {
                out.println("NO");
            }
        }

        public boolean solve(String input) {
            String word = input + "$";

            int totalStates = 5;
            int[] statePos = new int[totalStates];
            boolean[] activeStates = new boolean[totalStates];
            activeStates[0] = true;
            boolean atLeastOnActiveState = true;
            while (atLeastOnActiveState) {

                atLeastOnActiveState = false;
                boolean[] newStates = new boolean[totalStates];
                for (int stateId = 0; stateId < totalStates - 1; stateId++) {
                    if (activeStates[stateId]) {
                        atLeastOnActiveState = true;
                        processState(stateId, statePos, newStates, word);
                    }
                }

                if (newStates[4]) {
                    return true;
                }

                activeStates = newStates;
            }

            return false;
        }

        private void processState(int stateId, int[] statePos, boolean[] newStates, String word) {
            int startIdx = statePos[stateId];
            int nextStatePos = 0;
            switch (stateId) {
                case 0:
                    if ((nextStatePos = matchString(word, "dream", startIdx)) > 0) {
                        newStates[1] = true;
                        statePos[1] = nextStatePos;
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    }
                    break;
                case 1:
                    if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;

                        newStates[2] = true;
                        statePos[2] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "$", startIdx)) > 0) {
                        newStates[4] = true;
                    }
                    break;
                case 2:
                    if ((nextStatePos = matchString(word, "as", startIdx)) > 0) {
                        newStates[3] = true;
                        statePos[3] = nextStatePos;
                    }
                    break;
                case 3:
                    if ((nextStatePos = matchString(word, "er", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    } else if ((nextStatePos = matchString(word, "e", startIdx)) > 0) {
                        newStates[0] = true;
                        statePos[0] = nextStatePos;
                    }
                    break;
            }
        }

        private int matchString(String word, String target, int startIdx) {
            if (startIdx + target.length() > word.length()) {
                return -1;
            }

            for (int i = 0; i < target.length(); i++) {
                if (word.charAt(startIdx + i) != target.charAt(i)) {
                    return -1;
                }
            }

            return startIdx + target.length();
        }

    }
}

