import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        System.out.println( solve(S) );
    }

    private static String solve(String S) {
        String s = reverse(S);
        String t1 = reverse("dream");
        String t2 = reverse("dreamer");
        String t3 = reverse("erase");
        String t4 = reverse("eraser");
        int i = 0;

        while(true) {
            i = nextIndexOf(s, i, t1, t2, t3, t4);
            if( i == -1 ) return "NO";
            if( i == s.length() ) return "YES";
        }
    }

    private static String reverse(String s) {
        char[] rev = new char[s.length()];
        for (int i = 0, j = s.length() -1; i < s.length(); i++, j--) {
            rev[j] = s.charAt(i);
        }
        return new String(rev);
    }

    private static int nextIndexOf(String s, int i, String... ts) {
        for (String t : ts) {
            if( s.startsWith(t, i) ) {
                return i + t.length();
            }
        }
        return -1;
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        System.out.println( solve(S) );
    }

    private static String solve(String S) {
        String s = reverse(S);
        String t1 = reverse("dream");
        String t2 = reverse("dreamer");
        String t3 = reverse("erase");
        String t4 = reverse("eraser");
        int i = 0;

        while(true) {
            i = nextIndexOf(s, i, t1, t2, t3, t4);
            if( i == -1 ) return "NO";
            if( i == s.length() ) return "YES";
        }
    }

    private static String reverse(String s) {
        char[] rev = new char[s.length()];
        for (int i = 0, j = s.length() -1; i < s.length(); i++, j--) {
            rev[j] = s.charAt(i);
        }
        return new String(rev);
    }

    private static int nextIndexOf(String s, int i, String... ts) {
        for (String t : ts) {
            if( s.startsWith(t, i) ) {
                return i + t.length();
            }
        }
        return -1;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        System.out.println( solve(S) );
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        System.out.println( solve(S) );
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc System.out.println( solve(S) ) System.out.println System.out System System.out solve(S) solve S String[] args args private static String solve(String S) {
        String s = reverse(S);
        String t1 = reverse("dream");
        String t2 = reverse("dreamer");
        String t3 = reverse("erase");
        String t4 = reverse("eraser");
        int i = 0;

        while(true) {
            i = nextIndexOf(s, i, t1, t2, t3, t4);
            if( i == -1 ) return "NO";
            if( i == s.length() ) return "YES";
        }
    } solve {
        String s = reverse(S);
        String t1 = reverse("dream");
        String t2 = reverse("dreamer");
        String t3 = reverse("erase");
        String t4 = reverse("eraser");
        int i = 0;

        while(true) {
            i = nextIndexOf(s, i, t1, t2, t3, t4);
            if( i == -1 ) return "NO";
            if( i == s.length() ) return "YES";
        }
    } String s = reverse(S); s reverse(S) reverse S String t1 = reverse("dream"); t1 reverse("dream") reverse "dream" String t2 = reverse("dreamer"); t2 reverse("dreamer") reverse "dreamer" String t3 = reverse("erase"); t3 reverse("erase") reverse "erase" String t4 = reverse("eraser"); t4 reverse("eraser") reverse "eraser" int i = 0; i 0 while(true) {
            i = nextIndexOf(s, i, t1, t2, t3, t4);
            if( i == -1 ) return "NO";
            if( i == s.length() ) return "YES";
        } true {
            i = nextIndexOf(s, i, t1, t2, t3, t4);
            if( i == -1 ) return "NO";
            if( i == s.length() ) return "YES";
        } i = nextIndexOf(s, i, t1, t2, t3, t4) i nextIndexOf(s, i, t1, t2, t3, t4) nextIndexOf s i t1 t2 t3 t4 if( i == -1 ) return "NO"; i == -1 i -1 1 return "NO"; "NO" if( i == s.length() ) return "YES"; i == s.length() i s.length() s.length s return "YES"; "YES" String S S private static String reverse(String s) {
        char[] rev = new char[s.length()];
        for (int i = 0, j = s.length() -1; i < s.length(); i++, j--) {
            rev[j] = s.charAt(i);
        }
        return new String(rev);
    } reverse {
        char[] rev = new char[s.length()];
        for (int i = 0, j = s.length() -1; i < s.length(); i++, j--) {
            rev[j] = s.charAt(i);
        }
        return new String(rev);
    } char[] rev = new char[s.length()]; rev new char[s.length()] s.length() s.length s for (int i = 0, j = s.length() -1; i < s.length(); i++, j--) {
            rev[j] = s.charAt(i);
        } int i = 0, j = s.length() -1; int i = 0 i 0 j = s.length() -1; j s.length() -1 s.length() s.length s 1 i < s.length() i s.length() s.length s i++, j-- i++ i j-- j {
            rev[j] = s.charAt(i);
        } {
            rev[j] = s.charAt(i);
        } rev[j] = s.charAt(i) rev[j] rev j s.charAt(i) s.charAt s i return new String(rev); new String(rev) String s s private static int nextIndexOf(String s, int i, String... ts) {
        for (String t : ts) {
            if( s.startsWith(t, i) ) {
                return i + t.length();
            }
        }
        return -1;
    } nextIndexOf {
        for (String t : ts) {
            if( s.startsWith(t, i) ) {
                return i + t.length();
            }
        }
        return -1;
    } for (String t : ts) {
            if( s.startsWith(t, i) ) {
                return i + t.length();
            }
        } String t ts {
            if( s.startsWith(t, i) ) {
                return i + t.length();
            }
        } {
            if( s.startsWith(t, i) ) {
                return i + t.length();
            }
        } if( s.startsWith(t, i) ) {
                return i + t.length();
            } s.startsWith(t, i) s.startsWith s t i {
                return i + t.length();
            } return i + t.length(); i + t.length() i t.length() t.length t return -1; -1 1 String s s int i i String... ts ts public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        System.out.println( solve(S) );
    }

    private static String solve(String S) {
        String s = reverse(S);
        String t1 = reverse("dream");
        String t2 = reverse("dreamer");
        String t3 = reverse("erase");
        String t4 = reverse("eraser");
        int i = 0;

        while(true) {
            i = nextIndexOf(s, i, t1, t2, t3, t4);
            if( i == -1 ) return "NO";
            if( i == s.length() ) return "YES";
        }
    }

    private static String reverse(String s) {
        char[] rev = new char[s.length()];
        for (int i = 0, j = s.length() -1; i < s.length(); i++, j--) {
            rev[j] = s.charAt(i);
        }
        return new String(rev);
    }

    private static int nextIndexOf(String s, int i, String... ts) {
        for (String t : ts) {
            if( s.startsWith(t, i) ) {
                return i + t.length();
            }
        }
        return -1;
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        System.out.println( solve(S) );
    }

    private static String solve(String S) {
        String s = reverse(S);
        String t1 = reverse("dream");
        String t2 = reverse("dreamer");
        String t3 = reverse("erase");
        String t4 = reverse("eraser");
        int i = 0;

        while(true) {
            i = nextIndexOf(s, i, t1, t2, t3, t4);
            if( i == -1 ) return "NO";
            if( i == s.length() ) return "YES";
        }
    }

    private static String reverse(String s) {
        char[] rev = new char[s.length()];
        for (int i = 0, j = s.length() -1; i < s.length(); i++, j--) {
            rev[j] = s.charAt(i);
        }
        return new String(rev);
    }

    private static int nextIndexOf(String s, int i, String... ts) {
        for (String t : ts) {
            if( s.startsWith(t, i) ) {
                return i + t.length();
            }
        }
        return -1;
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        System.out.println( solve(S) );
    }

    private static String solve(String S) {
        String s = reverse(S);
        String t1 = reverse("dream");
        String t2 = reverse("dreamer");
        String t3 = reverse("erase");
        String t4 = reverse("eraser");
        int i = 0;

        while(true) {
            i = nextIndexOf(s, i, t1, t2, t3, t4);
            if( i == -1 ) return "NO";
            if( i == s.length() ) return "YES";
        }
    }

    private static String reverse(String s) {
        char[] rev = new char[s.length()];
        for (int i = 0, j = s.length() -1; i < s.length(); i++, j--) {
            rev[j] = s.charAt(i);
        }
        return new String(rev);
    }

    private static int nextIndexOf(String s, int i, String... ts) {
        for (String t : ts) {
            if( s.startsWith(t, i) ) {
                return i + t.length();
            }
        }
        return -1;
    }
}