import java.util.*;

public class Main {
    static int modP = 1000000007;

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

        int idx = s.length();
        boolean cond = false;
        while(idx >= 0) {
            if(cond) break;
            if(idx < 5) {
                print("NO");
                return;
            }

            String last5 = s.substring(idx-5, idx);
            if(last5.equals("dream") || last5.equals("erase")) {
                idx -= 5;
                if(idx == 0) cond = true;
                continue;
            }

            String last6 = s.substring(idx-6, idx);
            if(last6.equals("eraser")) {
                idx -= 6;
                if(idx == 0) cond = true;
                continue;
            }

            String last7 = s.substring(idx-7, idx);
            if(last7.equals("dreamer")) {
                idx -= 7;
                if(idx == 0) cond = true;
                continue;
            }

            break;
        }

        if(cond) {
            print("YES");
        }else{
            print("NO");
        }
    }

    static void print(String s) {
        System.out.println(s);
    }

    static void print(int i) {
        System.out.println(i);
    }
} import java.util.*; util.* java public class Main {
    static int modP = 1000000007;

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

        int idx = s.length();
        boolean cond = false;
        while(idx >= 0) {
            if(cond) break;
            if(idx < 5) {
                print("NO");
                return;
            }

            String last5 = s.substring(idx-5, idx);
            if(last5.equals("dream") || last5.equals("erase")) {
                idx -= 5;
                if(idx == 0) cond = true;
                continue;
            }

            String last6 = s.substring(idx-6, idx);
            if(last6.equals("eraser")) {
                idx -= 6;
                if(idx == 0) cond = true;
                continue;
            }

            String last7 = s.substring(idx-7, idx);
            if(last7.equals("dreamer")) {
                idx -= 7;
                if(idx == 0) cond = true;
                continue;
            }

            break;
        }

        if(cond) {
            print("YES");
        }else{
            print("NO");
        }
    }

    static void print(String s) {
        System.out.println(s);
    }

    static void print(int i) {
        System.out.println(i);
    }
} Main static int modP = 1000000007; modP 1000000007 public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();

        int idx = s.length();
        boolean cond = false;
        while(idx >= 0) {
            if(cond) break;
            if(idx < 5) {
                print("NO");
                return;
            }

            String last5 = s.substring(idx-5, idx);
            if(last5.equals("dream") || last5.equals("erase")) {
                idx -= 5;
                if(idx == 0) cond = true;
                continue;
            }

            String last6 = s.substring(idx-6, idx);
            if(last6.equals("eraser")) {
                idx -= 6;
                if(idx == 0) cond = true;
                continue;
            }

            String last7 = s.substring(idx-7, idx);
            if(last7.equals("dreamer")) {
                idx -= 7;
                if(idx == 0) cond = true;
                continue;
            }

            break;
        }

        if(cond) {
            print("YES");
        }else{
            print("NO");
        }
    } main {
        Scanner in = new Scanner(System.in);
        String s = in.next();

        int idx = s.length();
        boolean cond = false;
        while(idx >= 0) {
            if(cond) break;
            if(idx < 5) {
                print("NO");
                return;
            }

            String last5 = s.substring(idx-5, idx);
            if(last5.equals("dream") || last5.equals("erase")) {
                idx -= 5;
                if(idx == 0) cond = true;
                continue;
            }

            String last6 = s.substring(idx-6, idx);
            if(last6.equals("eraser")) {
                idx -= 6;
                if(idx == 0) cond = true;
                continue;
            }

            String last7 = s.substring(idx-7, idx);
            if(last7.equals("dreamer")) {
                idx -= 7;
                if(idx == 0) cond = true;
                continue;
            }

            break;
        }

        if(cond) {
            print("YES");
        }else{
            print("NO");
        }
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) String s = in.next(); s in.next() in.next in int idx = s.length(); idx s.length() s.length s boolean cond = false; cond false while(idx >= 0) {
            if(cond) break;
            if(idx < 5) {
                print("NO");
                return;
            }

            String last5 = s.substring(idx-5, idx);
            if(last5.equals("dream") || last5.equals("erase")) {
                idx -= 5;
                if(idx == 0) cond = true;
                continue;
            }

            String last6 = s.substring(idx-6, idx);
            if(last6.equals("eraser")) {
                idx -= 6;
                if(idx == 0) cond = true;
                continue;
            }

            String last7 = s.substring(idx-7, idx);
            if(last7.equals("dreamer")) {
                idx -= 7;
                if(idx == 0) cond = true;
                continue;
            }

            break;
        } idx >= 0 idx 0 {
            if(cond) break;
            if(idx < 5) {
                print("NO");
                return;
            }

            String last5 = s.substring(idx-5, idx);
            if(last5.equals("dream") || last5.equals("erase")) {
                idx -= 5;
                if(idx == 0) cond = true;
                continue;
            }

            String last6 = s.substring(idx-6, idx);
            if(last6.equals("eraser")) {
                idx -= 6;
                if(idx == 0) cond = true;
                continue;
            }

            String last7 = s.substring(idx-7, idx);
            if(last7.equals("dreamer")) {
                idx -= 7;
                if(idx == 0) cond = true;
                continue;
            }

            break;
        } if(cond) break; cond break; if(idx < 5) {
                print("NO");
                return;
            } idx < 5 idx 5 {
                print("NO");
                return;
            } print("NO") print "NO" return; String last5 = s.substring(idx-5, idx); last5 s.substring(idx-5, idx) s.substring s idx-5 idx 5 idx if(last5.equals("dream") || last5.equals("erase")) {
                idx -= 5;
                if(idx == 0) cond = true;
                continue;
            } last5.equals("dream") || last5.equals("erase") last5.equals("dream") last5.equals last5 "dream" last5.equals("erase") last5.equals last5 "erase" {
                idx -= 5;
                if(idx == 0) cond = true;
                continue;
            } idx -= 5 idx 5 if(idx == 0) cond = true; idx == 0 idx 0 cond = true cond true continue; String last6 = s.substring(idx-6, idx); last6 s.substring(idx-6, idx) s.substring s idx-6 idx 6 idx if(last6.equals("eraser")) {
                idx -= 6;
                if(idx == 0) cond = true;
                continue;
            } last6.equals("eraser") last6.equals last6 "eraser" {
                idx -= 6;
                if(idx == 0) cond = true;
                continue;
            } idx -= 6 idx 6 if(idx == 0) cond = true; idx == 0 idx 0 cond = true cond true continue; String last7 = s.substring(idx-7, idx); last7 s.substring(idx-7, idx) s.substring s idx-7 idx 7 idx if(last7.equals("dreamer")) {
                idx -= 7;
                if(idx == 0) cond = true;
                continue;
            } last7.equals("dreamer") last7.equals last7 "dreamer" {
                idx -= 7;
                if(idx == 0) cond = true;
                continue;
            } idx -= 7 idx 7 if(idx == 0) cond = true; idx == 0 idx 0 cond = true cond true continue; break; if(cond) {
            print("YES");
        }else{
            print("NO");
        } cond {
            print("YES");
        } print("YES") print "YES" {
            print("NO");
        } print("NO") print "NO" String[] args args static void print(String s) {
        System.out.println(s);
    } print {
        System.out.println(s);
    } System.out.println(s) System.out.println System.out System System.out s String s s static void print(int i) {
        System.out.println(i);
    } print {
        System.out.println(i);
    } System.out.println(i) System.out.println System.out System System.out i int i i public class Main {
    static int modP = 1000000007;

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

        int idx = s.length();
        boolean cond = false;
        while(idx >= 0) {
            if(cond) break;
            if(idx < 5) {
                print("NO");
                return;
            }

            String last5 = s.substring(idx-5, idx);
            if(last5.equals("dream") || last5.equals("erase")) {
                idx -= 5;
                if(idx == 0) cond = true;
                continue;
            }

            String last6 = s.substring(idx-6, idx);
            if(last6.equals("eraser")) {
                idx -= 6;
                if(idx == 0) cond = true;
                continue;
            }

            String last7 = s.substring(idx-7, idx);
            if(last7.equals("dreamer")) {
                idx -= 7;
                if(idx == 0) cond = true;
                continue;
            }

            break;
        }

        if(cond) {
            print("YES");
        }else{
            print("NO");
        }
    }

    static void print(String s) {
        System.out.println(s);
    }

    static void print(int i) {
        System.out.println(i);
    }
} public class Main {
    static int modP = 1000000007;

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

        int idx = s.length();
        boolean cond = false;
        while(idx >= 0) {
            if(cond) break;
            if(idx < 5) {
                print("NO");
                return;
            }

            String last5 = s.substring(idx-5, idx);
            if(last5.equals("dream") || last5.equals("erase")) {
                idx -= 5;
                if(idx == 0) cond = true;
                continue;
            }

            String last6 = s.substring(idx-6, idx);
            if(last6.equals("eraser")) {
                idx -= 6;
                if(idx == 0) cond = true;
                continue;
            }

            String last7 = s.substring(idx-7, idx);
            if(last7.equals("dreamer")) {
                idx -= 7;
                if(idx == 0) cond = true;
                continue;
            }

            break;
        }

        if(cond) {
            print("YES");
        }else{
            print("NO");
        }
    }

    static void print(String s) {
        System.out.println(s);
    }

    static void print(int i) {
        System.out.println(i);
    }
} Main
import java.util.*;

public class Main {
    static int modP = 1000000007;

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

        int idx = s.length();
        boolean cond = false;
        while(idx >= 0) {
            if(cond) break;
            if(idx < 5) {
                print("NO");
                return;
            }

            String last5 = s.substring(idx-5, idx);
            if(last5.equals("dream") || last5.equals("erase")) {
                idx -= 5;
                if(idx == 0) cond = true;
                continue;
            }

            String last6 = s.substring(idx-6, idx);
            if(last6.equals("eraser")) {
                idx -= 6;
                if(idx == 0) cond = true;
                continue;
            }

            String last7 = s.substring(idx-7, idx);
            if(last7.equals("dreamer")) {
                idx -= 7;
                if(idx == 0) cond = true;
                continue;
            }

            break;
        }

        if(cond) {
            print("YES");
        }else{
            print("NO");
        }
    }

    static void print(String s) {
        System.out.println(s);
    }

    static void print(int i) {
        System.out.println(i);
    }
}
