import java.util.*;

public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        String s = sc.next();
        StringBuilder sb = new StringBuilder();
        sb.append(s);
        sb.reverse();
        s = sb.toString();
//        char[] s = sc.next().toCharArray();

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

//        System.out.println(s);

        int idx = 0;

        out:
        while (idx < s.length()) {
            int cnt = 0;
            for (int i=0; i<4; i++) {
                if (s.substring(idx, Math.min(idx+8, s.length())).startsWith(arr[i])) {
                    idx += arr[i].length();
//                    s = s.replace(arr[i], "");
//                    System.out.println(s);
                    continue out;
                }
                cnt++;
            }
            if (cnt == 4) {
                System.out.println("NO");
                return;
            }
        }

        System.out.println("YES");


    }

}
 import java.util.*; util.* java public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        String s = sc.next();
        StringBuilder sb = new StringBuilder();
        sb.append(s);
        sb.reverse();
        s = sb.toString();
//        char[] s = sc.next().toCharArray();

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

//        System.out.println(s);

        int idx = 0;

        out:
        while (idx < s.length()) {
            int cnt = 0;
            for (int i=0; i<4; i++) {
                if (s.substring(idx, Math.min(idx+8, s.length())).startsWith(arr[i])) {
                    idx += arr[i].length();
//                    s = s.replace(arr[i], "");
//                    System.out.println(s);
                    continue out;
                }
                cnt++;
            }
            if (cnt == 4) {
                System.out.println("NO");
                return;
            }
        }

        System.out.println("YES");


    }

} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args void run() {

        String s = sc.next();
        StringBuilder sb = new StringBuilder();
        sb.append(s);
        sb.reverse();
        s = sb.toString();
//        char[] s = sc.next().toCharArray();

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

//        System.out.println(s);

        int idx = 0;

        out:
        while (idx < s.length()) {
            int cnt = 0;
            for (int i=0; i<4; i++) {
                if (s.substring(idx, Math.min(idx+8, s.length())).startsWith(arr[i])) {
                    idx += arr[i].length();
//                    s = s.replace(arr[i], "");
//                    System.out.println(s);
                    continue out;
                }
                cnt++;
            }
            if (cnt == 4) {
                System.out.println("NO");
                return;
            }
        }

        System.out.println("YES");


    } run {

        String s = sc.next();
        StringBuilder sb = new StringBuilder();
        sb.append(s);
        sb.reverse();
        s = sb.toString();
//        char[] s = sc.next().toCharArray();

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

//        System.out.println(s);

        int idx = 0;

        out:
        while (idx < s.length()) {
            int cnt = 0;
            for (int i=0; i<4; i++) {
                if (s.substring(idx, Math.min(idx+8, s.length())).startsWith(arr[i])) {
                    idx += arr[i].length();
//                    s = s.replace(arr[i], "");
//                    System.out.println(s);
                    continue out;
                }
                cnt++;
            }
            if (cnt == 4) {
                System.out.println("NO");
                return;
            }
        }

        System.out.println("YES");


    } String s = sc.next(); s sc.next() sc.next sc StringBuilder sb = new StringBuilder(); sb new StringBuilder() sb.append(s) sb.append sb s sb.reverse() sb.reverse sb s = sb.toString() s sb.toString() sb.toString sb String[] arr = {"maerd", "remaerd", "esare", "resare"}; arr {"maerd", "remaerd", "esare", "resare"} "maerd" "remaerd" "esare" "resare" int idx = 0; idx 0 System.out.println("YES") System.out.println System.out System System.out "YES" public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        String s = sc.next();
        StringBuilder sb = new StringBuilder();
        sb.append(s);
        sb.reverse();
        s = sb.toString();
//        char[] s = sc.next().toCharArray();

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

//        System.out.println(s);

        int idx = 0;

        out:
        while (idx < s.length()) {
            int cnt = 0;
            for (int i=0; i<4; i++) {
                if (s.substring(idx, Math.min(idx+8, s.length())).startsWith(arr[i])) {
                    idx += arr[i].length();
//                    s = s.replace(arr[i], "");
//                    System.out.println(s);
                    continue out;
                }
                cnt++;
            }
            if (cnt == 4) {
                System.out.println("NO");
                return;
            }
        }

        System.out.println("YES");


    }

} public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        String s = sc.next();
        StringBuilder sb = new StringBuilder();
        sb.append(s);
        sb.reverse();
        s = sb.toString();
//        char[] s = sc.next().toCharArray();

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

//        System.out.println(s);

        int idx = 0;

        out:
        while (idx < s.length()) {
            int cnt = 0;
            for (int i=0; i<4; i++) {
                if (s.substring(idx, Math.min(idx+8, s.length())).startsWith(arr[i])) {
                    idx += arr[i].length();
//                    s = s.replace(arr[i], "");
//                    System.out.println(s);
                    continue out;
                }
                cnt++;
            }
            if (cnt == 4) {
                System.out.println("NO");
                return;
            }
        }

        System.out.println("YES");


    }

} Main
import java.util.*;

public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        String s = sc.next();
        StringBuilder sb = new StringBuilder();
        sb.append(s);
        sb.reverse();
        s = sb.toString();
//        char[] s = sc.next().toCharArray();

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

//        System.out.println(s);

        int idx = 0;

        out:
        while (idx < s.length()) {
            int cnt = 0;
            for (int i=0; i<4; i++) {
                if (s.substring(idx, Math.min(idx+8, s.length())).startsWith(arr[i])) {
                    idx += arr[i].length();
//                    s = s.replace(arr[i], "");
//                    System.out.println(s);
                    continue out;
                }
                cnt++;
            }
            if (cnt == 4) {
                System.out.println("NO");
                return;
            }
        }

        System.out.println("YES");


    }

}

