import java.util.*;

public class Main {
    static String[] strs = {
        "maerd",
        "remaerd",
        "esare",
        "resare"
    };
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        StringBuffer s = new StringBuffer(100000);
        String s_in = sc.next();
        s.append(s_in);
        s.reverse();

        while (true) {
            boolean startsWithStr = false;
            for (String str: strs) {
                if (s.indexOf(str) == 0) {
                    startsWithStr = true;
                    s = s.delete(0, str.length());
                    break;
                }
            }
            if (!startsWithStr) {
                System.out.println("NO");
                break;
            }
            if (s.length() <= 0) {
                System.out.println("YES");
                break;
            }
        }
    }
} import java.util.*; util.* java public class Main {
    static String[] strs = {
        "maerd",
        "remaerd",
        "esare",
        "resare"
    };
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        StringBuffer s = new StringBuffer(100000);
        String s_in = sc.next();
        s.append(s_in);
        s.reverse();

        while (true) {
            boolean startsWithStr = false;
            for (String str: strs) {
                if (s.indexOf(str) == 0) {
                    startsWithStr = true;
                    s = s.delete(0, str.length());
                    break;
                }
            }
            if (!startsWithStr) {
                System.out.println("NO");
                break;
            }
            if (s.length() <= 0) {
                System.out.println("YES");
                break;
            }
        }
    }
} Main static String[] strs = {
        "maerd",
        "remaerd",
        "esare",
        "resare"
    }; strs {
        "maerd",
        "remaerd",
        "esare",
        "resare"
    } "maerd" "remaerd" "esare" "resare" public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        StringBuffer s = new StringBuffer(100000);
        String s_in = sc.next();
        s.append(s_in);
        s.reverse();

        while (true) {
            boolean startsWithStr = false;
            for (String str: strs) {
                if (s.indexOf(str) == 0) {
                    startsWithStr = true;
                    s = s.delete(0, str.length());
                    break;
                }
            }
            if (!startsWithStr) {
                System.out.println("NO");
                break;
            }
            if (s.length() <= 0) {
                System.out.println("YES");
                break;
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        StringBuffer s = new StringBuffer(100000);
        String s_in = sc.next();
        s.append(s_in);
        s.reverse();

        while (true) {
            boolean startsWithStr = false;
            for (String str: strs) {
                if (s.indexOf(str) == 0) {
                    startsWithStr = true;
                    s = s.delete(0, str.length());
                    break;
                }
            }
            if (!startsWithStr) {
                System.out.println("NO");
                break;
            }
            if (s.length() <= 0) {
                System.out.println("YES");
                break;
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuffer s = new StringBuffer(100000); s new StringBuffer(100000) String s_in = sc.next(); s_in sc.next() sc.next sc s.append(s_in) s.append s s_in s.reverse() s.reverse s while (true) {
            boolean startsWithStr = false;
            for (String str: strs) {
                if (s.indexOf(str) == 0) {
                    startsWithStr = true;
                    s = s.delete(0, str.length());
                    break;
                }
            }
            if (!startsWithStr) {
                System.out.println("NO");
                break;
            }
            if (s.length() <= 0) {
                System.out.println("YES");
                break;
            }
        } true {
            boolean startsWithStr = false;
            for (String str: strs) {
                if (s.indexOf(str) == 0) {
                    startsWithStr = true;
                    s = s.delete(0, str.length());
                    break;
                }
            }
            if (!startsWithStr) {
                System.out.println("NO");
                break;
            }
            if (s.length() <= 0) {
                System.out.println("YES");
                break;
            }
        } boolean startsWithStr = false; startsWithStr false for (String str: strs) {
                if (s.indexOf(str) == 0) {
                    startsWithStr = true;
                    s = s.delete(0, str.length());
                    break;
                }
            } String str strs {
                if (s.indexOf(str) == 0) {
                    startsWithStr = true;
                    s = s.delete(0, str.length());
                    break;
                }
            } {
                if (s.indexOf(str) == 0) {
                    startsWithStr = true;
                    s = s.delete(0, str.length());
                    break;
                }
            } if (s.indexOf(str) == 0) {
                    startsWithStr = true;
                    s = s.delete(0, str.length());
                    break;
                } s.indexOf(str) == 0 s.indexOf(str) s.indexOf s str 0 {
                    startsWithStr = true;
                    s = s.delete(0, str.length());
                    break;
                } startsWithStr = true startsWithStr true s = s.delete(0, str.length()) s s.delete(0, str.length()) s.delete s 0 str.length() str.length str break; if (!startsWithStr) {
                System.out.println("NO");
                break;
            } !startsWithStr startsWithStr {
                System.out.println("NO");
                break;
            } System.out.println("NO") System.out.println System.out System System.out "NO" break; if (s.length() <= 0) {
                System.out.println("YES");
                break;
            } s.length() <= 0 s.length() s.length s 0 {
                System.out.println("YES");
                break;
            } System.out.println("YES") System.out.println System.out System System.out "YES" break; String[] args args public class Main {
    static String[] strs = {
        "maerd",
        "remaerd",
        "esare",
        "resare"
    };
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        StringBuffer s = new StringBuffer(100000);
        String s_in = sc.next();
        s.append(s_in);
        s.reverse();

        while (true) {
            boolean startsWithStr = false;
            for (String str: strs) {
                if (s.indexOf(str) == 0) {
                    startsWithStr = true;
                    s = s.delete(0, str.length());
                    break;
                }
            }
            if (!startsWithStr) {
                System.out.println("NO");
                break;
            }
            if (s.length() <= 0) {
                System.out.println("YES");
                break;
            }
        }
    }
} public class Main {
    static String[] strs = {
        "maerd",
        "remaerd",
        "esare",
        "resare"
    };
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        StringBuffer s = new StringBuffer(100000);
        String s_in = sc.next();
        s.append(s_in);
        s.reverse();

        while (true) {
            boolean startsWithStr = false;
            for (String str: strs) {
                if (s.indexOf(str) == 0) {
                    startsWithStr = true;
                    s = s.delete(0, str.length());
                    break;
                }
            }
            if (!startsWithStr) {
                System.out.println("NO");
                break;
            }
            if (s.length() <= 0) {
                System.out.println("YES");
                break;
            }
        }
    }
} Main
import java.util.*;

public class Main {
    static String[] strs = {
        "maerd",
        "remaerd",
        "esare",
        "resare"
    };
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        StringBuffer s = new StringBuffer(100000);
        String s_in = sc.next();
        s.append(s_in);
        s.reverse();

        while (true) {
            boolean startsWithStr = false;
            for (String str: strs) {
                if (s.indexOf(str) == 0) {
                    startsWithStr = true;
                    s = s.delete(0, str.length());
                    break;
                }
            }
            if (!startsWithStr) {
                System.out.println("NO");
                break;
            }
            if (s.length() <= 0) {
                System.out.println("YES");
                break;
            }
        }
    }
}