import java.util.Scanner;

/**
 *
 * @author psygn
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        String str = scanner.nextLine();
        StringBuilder sb = new StringBuilder(str);
        String rev = sb.reverse().toString();
        String ans = "NO";
        int i = 0;
        while (true) {
            if (i == rev.length()) {
                ans = "YES";
                break;
            }
            try {
                if ("esare".equals(rev.substring(i, i+5))) {
                    i += 5;
                } else if ("maerd".equals(rev.substring(i, i+5))) {
                    i += 5;
                }  else if ("resare".equals(rev.substring(i, i+6))) {
                    i += 6;
                } else if ("remaerd".equals(rev.substring(i, i+7))) {
                    i += 7;
                } else {
                    break;
                }
            } catch (Exception e) {
                break;
            }
        }
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        String str = scanner.nextLine();
        StringBuilder sb = new StringBuilder(str);
        String rev = sb.reverse().toString();
        String ans = "NO";
        int i = 0;
        while (true) {
            if (i == rev.length()) {
                ans = "YES";
                break;
            }
            try {
                if ("esare".equals(rev.substring(i, i+5))) {
                    i += 5;
                } else if ("maerd".equals(rev.substring(i, i+5))) {
                    i += 5;
                }  else if ("resare".equals(rev.substring(i, i+6))) {
                    i += 6;
                } else if ("remaerd".equals(rev.substring(i, i+7))) {
                    i += 7;
                } else {
                    break;
                }
            } catch (Exception e) {
                break;
            }
        }
        System.out.println(ans);
    }
} Main /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        String str = scanner.nextLine();
        StringBuilder sb = new StringBuilder(str);
        String rev = sb.reverse().toString();
        String ans = "NO";
        int i = 0;
        while (true) {
            if (i == rev.length()) {
                ans = "YES";
                break;
            }
            try {
                if ("esare".equals(rev.substring(i, i+5))) {
                    i += 5;
                } else if ("maerd".equals(rev.substring(i, i+5))) {
                    i += 5;
                }  else if ("resare".equals(rev.substring(i, i+6))) {
                    i += 6;
                } else if ("remaerd".equals(rev.substring(i, i+7))) {
                    i += 7;
                } else {
                    break;
                }
            } catch (Exception e) {
                break;
            }
        }
        System.out.println(ans);
    } main {

        Scanner scanner = new Scanner(System.in);

        String str = scanner.nextLine();
        StringBuilder sb = new StringBuilder(str);
        String rev = sb.reverse().toString();
        String ans = "NO";
        int i = 0;
        while (true) {
            if (i == rev.length()) {
                ans = "YES";
                break;
            }
            try {
                if ("esare".equals(rev.substring(i, i+5))) {
                    i += 5;
                } else if ("maerd".equals(rev.substring(i, i+5))) {
                    i += 5;
                }  else if ("resare".equals(rev.substring(i, i+6))) {
                    i += 6;
                } else if ("remaerd".equals(rev.substring(i, i+7))) {
                    i += 7;
                } else {
                    break;
                }
            } catch (Exception e) {
                break;
            }
        }
        System.out.println(ans);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String str = scanner.nextLine(); str scanner.nextLine() scanner.nextLine scanner StringBuilder sb = new StringBuilder(str); sb new StringBuilder(str) String rev = sb.reverse().toString(); rev sb.reverse().toString() sb.reverse().toString sb.reverse() sb.reverse sb String ans = "NO"; ans "NO" int i = 0; i 0 while (true) {
            if (i == rev.length()) {
                ans = "YES";
                break;
            }
            try {
                if ("esare".equals(rev.substring(i, i+5))) {
                    i += 5;
                } else if ("maerd".equals(rev.substring(i, i+5))) {
                    i += 5;
                }  else if ("resare".equals(rev.substring(i, i+6))) {
                    i += 6;
                } else if ("remaerd".equals(rev.substring(i, i+7))) {
                    i += 7;
                } else {
                    break;
                }
            } catch (Exception e) {
                break;
            }
        } true {
            if (i == rev.length()) {
                ans = "YES";
                break;
            }
            try {
                if ("esare".equals(rev.substring(i, i+5))) {
                    i += 5;
                } else if ("maerd".equals(rev.substring(i, i+5))) {
                    i += 5;
                }  else if ("resare".equals(rev.substring(i, i+6))) {
                    i += 6;
                } else if ("remaerd".equals(rev.substring(i, i+7))) {
                    i += 7;
                } else {
                    break;
                }
            } catch (Exception e) {
                break;
            }
        } if (i == rev.length()) {
                ans = "YES";
                break;
            } i == rev.length() i rev.length() rev.length rev {
                ans = "YES";
                break;
            } ans = "YES" ans "YES" break; try {
                if ("esare".equals(rev.substring(i, i+5))) {
                    i += 5;
                } else if ("maerd".equals(rev.substring(i, i+5))) {
                    i += 5;
                }  else if ("resare".equals(rev.substring(i, i+6))) {
                    i += 6;
                } else if ("remaerd".equals(rev.substring(i, i+7))) {
                    i += 7;
                } else {
                    break;
                }
            } catch (Exception e) {
                break;
            } catch (Exception e) {
                break;
            } Exception e {
                break;
            } break; {
                if ("esare".equals(rev.substring(i, i+5))) {
                    i += 5;
                } else if ("maerd".equals(rev.substring(i, i+5))) {
                    i += 5;
                }  else if ("resare".equals(rev.substring(i, i+6))) {
                    i += 6;
                } else if ("remaerd".equals(rev.substring(i, i+7))) {
                    i += 7;
                } else {
                    break;
                }
            } if ("esare".equals(rev.substring(i, i+5))) {
                    i += 5;
                } else if ("maerd".equals(rev.substring(i, i+5))) {
                    i += 5;
                }  else if ("resare".equals(rev.substring(i, i+6))) {
                    i += 6;
                } else if ("remaerd".equals(rev.substring(i, i+7))) {
                    i += 7;
                } else {
                    break;
                } "esare".equals(rev.substring(i, i+5)) "esare".equals "esare" rev.substring(i, i+5) rev.substring rev i i+5 i 5 {
                    i += 5;
                } i += 5 i 5 if ("maerd".equals(rev.substring(i, i+5))) {
                    i += 5;
                }  else if ("resare".equals(rev.substring(i, i+6))) {
                    i += 6;
                } else if ("remaerd".equals(rev.substring(i, i+7))) {
                    i += 7;
                } else {
                    break;
                } "maerd".equals(rev.substring(i, i+5)) "maerd".equals "maerd" rev.substring(i, i+5) rev.substring rev i i+5 i 5 {
                    i += 5;
                } i += 5 i 5 if ("resare".equals(rev.substring(i, i+6))) {
                    i += 6;
                } else if ("remaerd".equals(rev.substring(i, i+7))) {
                    i += 7;
                } else {
                    break;
                } "resare".equals(rev.substring(i, i+6)) "resare".equals "resare" rev.substring(i, i+6) rev.substring rev i i+6 i 6 {
                    i += 6;
                } i += 6 i 6 if ("remaerd".equals(rev.substring(i, i+7))) {
                    i += 7;
                } else {
                    break;
                } "remaerd".equals(rev.substring(i, i+7)) "remaerd".equals "remaerd" rev.substring(i, i+7) rev.substring rev i i+7 i 7 {
                    i += 7;
                } i += 7 i 7 {
                    break;
                } break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        String str = scanner.nextLine();
        StringBuilder sb = new StringBuilder(str);
        String rev = sb.reverse().toString();
        String ans = "NO";
        int i = 0;
        while (true) {
            if (i == rev.length()) {
                ans = "YES";
                break;
            }
            try {
                if ("esare".equals(rev.substring(i, i+5))) {
                    i += 5;
                } else if ("maerd".equals(rev.substring(i, i+5))) {
                    i += 5;
                }  else if ("resare".equals(rev.substring(i, i+6))) {
                    i += 6;
                } else if ("remaerd".equals(rev.substring(i, i+7))) {
                    i += 7;
                } else {
                    break;
                }
            } catch (Exception e) {
                break;
            }
        }
        System.out.println(ans);
    }
} public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        String str = scanner.nextLine();
        StringBuilder sb = new StringBuilder(str);
        String rev = sb.reverse().toString();
        String ans = "NO";
        int i = 0;
        while (true) {
            if (i == rev.length()) {
                ans = "YES";
                break;
            }
            try {
                if ("esare".equals(rev.substring(i, i+5))) {
                    i += 5;
                } else if ("maerd".equals(rev.substring(i, i+5))) {
                    i += 5;
                }  else if ("resare".equals(rev.substring(i, i+6))) {
                    i += 6;
                } else if ("remaerd".equals(rev.substring(i, i+7))) {
                    i += 7;
                } else {
                    break;
                }
            } catch (Exception e) {
                break;
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.Scanner;

/**
 *
 * @author psygn
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        String str = scanner.nextLine();
        StringBuilder sb = new StringBuilder(str);
        String rev = sb.reverse().toString();
        String ans = "NO";
        int i = 0;
        while (true) {
            if (i == rev.length()) {
                ans = "YES";
                break;
            }
            try {
                if ("esare".equals(rev.substring(i, i+5))) {
                    i += 5;
                } else if ("maerd".equals(rev.substring(i, i+5))) {
                    i += 5;
                }  else if ("resare".equals(rev.substring(i, i+6))) {
                    i += 6;
                } else if ("remaerd".equals(rev.substring(i, i+7))) {
                    i += 7;
                } else {
                    break;
                }
            } catch (Exception e) {
                break;
            }
        }
        System.out.println(ans);
    }
}