import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        List<String> list = new ArrayList<>();
        list.add("maerd");
        list.add("remaerd");
        list.add("esare");
        list.add("resare");

        StringBuilder sb = new StringBuilder(s);
        s = sb.reverse().toString();

        for (int i = 0; i < s.length(); ) {
            boolean flag = false;
            for (String str : list) {
                if (s.startsWith(str, i)) {
                    i += str.length();
                    flag = true;
                    break;
                }

            }
            if (!flag) {
                System.out.println("NO");
                return;
            }
        }
        System.out.println("YES");
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        List<String> list = new ArrayList<>();
        list.add("maerd");
        list.add("remaerd");
        list.add("esare");
        list.add("resare");

        StringBuilder sb = new StringBuilder(s);
        s = sb.reverse().toString();

        for (int i = 0; i < s.length(); ) {
            boolean flag = false;
            for (String str : list) {
                if (s.startsWith(str, i)) {
                    i += str.length();
                    flag = true;
                    break;
                }

            }
            if (!flag) {
                System.out.println("NO");
                return;
            }
        }
        System.out.println("YES");
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        List<String> list = new ArrayList<>();
        list.add("maerd");
        list.add("remaerd");
        list.add("esare");
        list.add("resare");

        StringBuilder sb = new StringBuilder(s);
        s = sb.reverse().toString();

        for (int i = 0; i < s.length(); ) {
            boolean flag = false;
            for (String str : list) {
                if (s.startsWith(str, i)) {
                    i += str.length();
                    flag = true;
                    break;
                }

            }
            if (!flag) {
                System.out.println("NO");
                return;
            }
        }
        System.out.println("YES");
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        List<String> list = new ArrayList<>();
        list.add("maerd");
        list.add("remaerd");
        list.add("esare");
        list.add("resare");

        StringBuilder sb = new StringBuilder(s);
        s = sb.reverse().toString();

        for (int i = 0; i < s.length(); ) {
            boolean flag = false;
            for (String str : list) {
                if (s.startsWith(str, i)) {
                    i += str.length();
                    flag = true;
                    break;
                }

            }
            if (!flag) {
                System.out.println("NO");
                return;
            }
        }
        System.out.println("YES");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc List<String> list = new ArrayList<>(); list new ArrayList<>() list.add("maerd") list.add list "maerd" list.add("remaerd") list.add list "remaerd" list.add("esare") list.add list "esare" list.add("resare") list.add list "resare" StringBuilder sb = new StringBuilder(s); sb new StringBuilder(s) s = sb.reverse().toString() s sb.reverse().toString() sb.reverse().toString sb.reverse() sb.reverse sb for (int i = 0; i < s.length(); ) {
            boolean flag = false;
            for (String str : list) {
                if (s.startsWith(str, i)) {
                    i += str.length();
                    flag = true;
                    break;
                }

            }
            if (!flag) {
                System.out.println("NO");
                return;
            }
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s {
            boolean flag = false;
            for (String str : list) {
                if (s.startsWith(str, i)) {
                    i += str.length();
                    flag = true;
                    break;
                }

            }
            if (!flag) {
                System.out.println("NO");
                return;
            }
        } {
            boolean flag = false;
            for (String str : list) {
                if (s.startsWith(str, i)) {
                    i += str.length();
                    flag = true;
                    break;
                }

            }
            if (!flag) {
                System.out.println("NO");
                return;
            }
        } boolean flag = false; flag false for (String str : list) {
                if (s.startsWith(str, i)) {
                    i += str.length();
                    flag = true;
                    break;
                }

            } String str list {
                if (s.startsWith(str, i)) {
                    i += str.length();
                    flag = true;
                    break;
                }

            } {
                if (s.startsWith(str, i)) {
                    i += str.length();
                    flag = true;
                    break;
                }

            } if (s.startsWith(str, i)) {
                    i += str.length();
                    flag = true;
                    break;
                } s.startsWith(str, i) s.startsWith s str i {
                    i += str.length();
                    flag = true;
                    break;
                } i += str.length() i str.length() str.length str flag = true flag true break; if (!flag) {
                System.out.println("NO");
                return;
            } !flag flag {
                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 public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        List<String> list = new ArrayList<>();
        list.add("maerd");
        list.add("remaerd");
        list.add("esare");
        list.add("resare");

        StringBuilder sb = new StringBuilder(s);
        s = sb.reverse().toString();

        for (int i = 0; i < s.length(); ) {
            boolean flag = false;
            for (String str : list) {
                if (s.startsWith(str, i)) {
                    i += str.length();
                    flag = true;
                    break;
                }

            }
            if (!flag) {
                System.out.println("NO");
                return;
            }
        }
        System.out.println("YES");
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        List<String> list = new ArrayList<>();
        list.add("maerd");
        list.add("remaerd");
        list.add("esare");
        list.add("resare");

        StringBuilder sb = new StringBuilder(s);
        s = sb.reverse().toString();

        for (int i = 0; i < s.length(); ) {
            boolean flag = false;
            for (String str : list) {
                if (s.startsWith(str, i)) {
                    i += str.length();
                    flag = true;
                    break;
                }

            }
            if (!flag) {
                System.out.println("NO");
                return;
            }
        }
        System.out.println("YES");
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        List<String> list = new ArrayList<>();
        list.add("maerd");
        list.add("remaerd");
        list.add("esare");
        list.add("resare");

        StringBuilder sb = new StringBuilder(s);
        s = sb.reverse().toString();

        for (int i = 0; i < s.length(); ) {
            boolean flag = false;
            for (String str : list) {
                if (s.startsWith(str, i)) {
                    i += str.length();
                    flag = true;
                    break;
                }

            }
            if (!flag) {
                System.out.println("NO");
                return;
            }
        }
        System.out.println("YES");
    }
}