import java.util.*;

class Main {

    private static boolean startWith(char[] chars, String str, int offset) {
        char[] strChars = str.toCharArray();
        if (offset + str.length() > chars.length) {
            return false;
        }
        for (int i = 0; i < strChars.length; i++) {
            if (chars[i + offset] != strChars[i]) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] tmp = sc.next().toCharArray();
        char[] T = new char[tmp.length];
        for (int i = 0; i < tmp.length; i++) {
            T[i] = tmp[tmp.length - 1 - i];
        }

        String[] words = new String[] {
                "maerd",
                "remaerd",
                "esare",
                "resare",
        };

        int offset = 0;
        while (true) {
            boolean notFound = true;
            for (int i = 0; i < words.length; i++) {
                if (startWith(T, words[i], offset)) {
                    notFound = false;
                    for (int j = offset; j < offset + words[i].length(); j++) {
                        T[j] = '.';
                    }
                    offset += words[i].length();
                }
            }
            if (notFound) {
                break;
            }
        }

        for (int i = 0; i < T.length; i++) {
            if (T[i] != '.') {
                System.out.println("NO");
                return;
            }
        }
        System.out.println("YES");
    }
} import java.util.*; util.* java class Main {

    private static boolean startWith(char[] chars, String str, int offset) {
        char[] strChars = str.toCharArray();
        if (offset + str.length() > chars.length) {
            return false;
        }
        for (int i = 0; i < strChars.length; i++) {
            if (chars[i + offset] != strChars[i]) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] tmp = sc.next().toCharArray();
        char[] T = new char[tmp.length];
        for (int i = 0; i < tmp.length; i++) {
            T[i] = tmp[tmp.length - 1 - i];
        }

        String[] words = new String[] {
                "maerd",
                "remaerd",
                "esare",
                "resare",
        };

        int offset = 0;
        while (true) {
            boolean notFound = true;
            for (int i = 0; i < words.length; i++) {
                if (startWith(T, words[i], offset)) {
                    notFound = false;
                    for (int j = offset; j < offset + words[i].length(); j++) {
                        T[j] = '.';
                    }
                    offset += words[i].length();
                }
            }
            if (notFound) {
                break;
            }
        }

        for (int i = 0; i < T.length; i++) {
            if (T[i] != '.') {
                System.out.println("NO");
                return;
            }
        }
        System.out.println("YES");
    }
} Main private static boolean startWith(char[] chars, String str, int offset) {
        char[] strChars = str.toCharArray();
        if (offset + str.length() > chars.length) {
            return false;
        }
        for (int i = 0; i < strChars.length; i++) {
            if (chars[i + offset] != strChars[i]) {
                return false;
            }
        }
        return true;
    } startWith {
        char[] strChars = str.toCharArray();
        if (offset + str.length() > chars.length) {
            return false;
        }
        for (int i = 0; i < strChars.length; i++) {
            if (chars[i + offset] != strChars[i]) {
                return false;
            }
        }
        return true;
    } char[] strChars = str.toCharArray(); strChars str.toCharArray() str.toCharArray str if (offset + str.length() > chars.length) {
            return false;
        } offset + str.length() > chars.length offset + str.length() offset str.length() str.length str chars.length chars chars.length {
            return false;
        } return false; false for (int i = 0; i < strChars.length; i++) {
            if (chars[i + offset] != strChars[i]) {
                return false;
            }
        } int i = 0; int i = 0; i 0 i < strChars.length i strChars.length strChars strChars.length i++ i++ i {
            if (chars[i + offset] != strChars[i]) {
                return false;
            }
        } {
            if (chars[i + offset] != strChars[i]) {
                return false;
            }
        } if (chars[i + offset] != strChars[i]) {
                return false;
            } chars[i + offset] != strChars[i] chars[i + offset] chars i + offset i offset strChars[i] strChars i {
                return false;
            } return false; false return true; true char[] chars chars String str str int offset offset public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] tmp = sc.next().toCharArray();
        char[] T = new char[tmp.length];
        for (int i = 0; i < tmp.length; i++) {
            T[i] = tmp[tmp.length - 1 - i];
        }

        String[] words = new String[] {
                "maerd",
                "remaerd",
                "esare",
                "resare",
        };

        int offset = 0;
        while (true) {
            boolean notFound = true;
            for (int i = 0; i < words.length; i++) {
                if (startWith(T, words[i], offset)) {
                    notFound = false;
                    for (int j = offset; j < offset + words[i].length(); j++) {
                        T[j] = '.';
                    }
                    offset += words[i].length();
                }
            }
            if (notFound) {
                break;
            }
        }

        for (int i = 0; i < T.length; i++) {
            if (T[i] != '.') {
                System.out.println("NO");
                return;
            }
        }
        System.out.println("YES");
    } main {
        Scanner sc = new Scanner(System.in);
        char[] tmp = sc.next().toCharArray();
        char[] T = new char[tmp.length];
        for (int i = 0; i < tmp.length; i++) {
            T[i] = tmp[tmp.length - 1 - i];
        }

        String[] words = new String[] {
                "maerd",
                "remaerd",
                "esare",
                "resare",
        };

        int offset = 0;
        while (true) {
            boolean notFound = true;
            for (int i = 0; i < words.length; i++) {
                if (startWith(T, words[i], offset)) {
                    notFound = false;
                    for (int j = offset; j < offset + words[i].length(); j++) {
                        T[j] = '.';
                    }
                    offset += words[i].length();
                }
            }
            if (notFound) {
                break;
            }
        }

        for (int i = 0; i < T.length; i++) {
            if (T[i] != '.') {
                System.out.println("NO");
                return;
            }
        }
        System.out.println("YES");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] tmp = sc.next().toCharArray(); tmp sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc char[] T = new char[tmp.length]; T new char[tmp.length] tmp.length tmp tmp.length for (int i = 0; i < tmp.length; i++) {
            T[i] = tmp[tmp.length - 1 - i];
        } int i = 0; int i = 0; i 0 i < tmp.length i tmp.length tmp tmp.length i++ i++ i {
            T[i] = tmp[tmp.length - 1 - i];
        } {
            T[i] = tmp[tmp.length - 1 - i];
        } T[i] = tmp[tmp.length - 1 - i] T[i] T i tmp[tmp.length - 1 - i] tmp tmp.length - 1 - i tmp.length - 1 - i tmp.length tmp tmp.length 1 i String[] words = new String[] {
                "maerd",
                "remaerd",
                "esare",
                "resare",
        }; words new String[] {
                "maerd",
                "remaerd",
                "esare",
                "resare",
        } int offset = 0; offset 0 while (true) {
            boolean notFound = true;
            for (int i = 0; i < words.length; i++) {
                if (startWith(T, words[i], offset)) {
                    notFound = false;
                    for (int j = offset; j < offset + words[i].length(); j++) {
                        T[j] = '.';
                    }
                    offset += words[i].length();
                }
            }
            if (notFound) {
                break;
            }
        } true {
            boolean notFound = true;
            for (int i = 0; i < words.length; i++) {
                if (startWith(T, words[i], offset)) {
                    notFound = false;
                    for (int j = offset; j < offset + words[i].length(); j++) {
                        T[j] = '.';
                    }
                    offset += words[i].length();
                }
            }
            if (notFound) {
                break;
            }
        } boolean notFound = true; notFound true for (int i = 0; i < words.length; i++) {
                if (startWith(T, words[i], offset)) {
                    notFound = false;
                    for (int j = offset; j < offset + words[i].length(); j++) {
                        T[j] = '.';
                    }
                    offset += words[i].length();
                }
            } int i = 0; int i = 0; i 0 i < words.length i words.length words words.length i++ i++ i {
                if (startWith(T, words[i], offset)) {
                    notFound = false;
                    for (int j = offset; j < offset + words[i].length(); j++) {
                        T[j] = '.';
                    }
                    offset += words[i].length();
                }
            } {
                if (startWith(T, words[i], offset)) {
                    notFound = false;
                    for (int j = offset; j < offset + words[i].length(); j++) {
                        T[j] = '.';
                    }
                    offset += words[i].length();
                }
            } if (startWith(T, words[i], offset)) {
                    notFound = false;
                    for (int j = offset; j < offset + words[i].length(); j++) {
                        T[j] = '.';
                    }
                    offset += words[i].length();
                } startWith(T, words[i], offset) startWith T words[i] words i offset {
                    notFound = false;
                    for (int j = offset; j < offset + words[i].length(); j++) {
                        T[j] = '.';
                    }
                    offset += words[i].length();
                } notFound = false notFound false for (int j = offset; j < offset + words[i].length(); j++) {
                        T[j] = '.';
                    } int j = offset; int j = offset; j offset j < offset + words[i].length() j offset + words[i].length() offset words[i].length() words[i].length words[i] words i j++ j++ j {
                        T[j] = '.';
                    } {
                        T[j] = '.';
                    } T[j] = '.' T[j] T j '.' offset += words[i].length() offset words[i].length() words[i].length words[i] words i if (notFound) {
                break;
            } notFound {
                break;
            } break; for (int i = 0; i < T.length; i++) {
            if (T[i] != '.') {
                System.out.println("NO");
                return;
            }
        } int i = 0; int i = 0; i 0 i < T.length i T.length T T.length i++ i++ i {
            if (T[i] != '.') {
                System.out.println("NO");
                return;
            }
        } {
            if (T[i] != '.') {
                System.out.println("NO");
                return;
            }
        } if (T[i] != '.') {
                System.out.println("NO");
                return;
            } T[i] != '.' T[i] T i '.' {
                System.out.println("NO");
                return;
            } System.out.println("NO") System.out.println System.out System System.out "NO" return; System.out.println("YES") System.out.println System.out System System.out "YES" String[] args args
import java.util.*;

class Main {

    private static boolean startWith(char[] chars, String str, int offset) {
        char[] strChars = str.toCharArray();
        if (offset + str.length() > chars.length) {
            return false;
        }
        for (int i = 0; i < strChars.length; i++) {
            if (chars[i + offset] != strChars[i]) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] tmp = sc.next().toCharArray();
        char[] T = new char[tmp.length];
        for (int i = 0; i < tmp.length; i++) {
            T[i] = tmp[tmp.length - 1 - i];
        }

        String[] words = new String[] {
                "maerd",
                "remaerd",
                "esare",
                "resare",
        };

        int offset = 0;
        while (true) {
            boolean notFound = true;
            for (int i = 0; i < words.length; i++) {
                if (startWith(T, words[i], offset)) {
                    notFound = false;
                    for (int j = offset; j < offset + words[i].length(); j++) {
                        T[j] = '.';
                    }
                    offset += words[i].length();
                }
            }
            if (notFound) {
                break;
            }
        }

        for (int i = 0; i < T.length; i++) {
            if (T[i] != '.') {
                System.out.println("NO");
                return;
            }
        }
        System.out.println("YES");
    }
}