import java.util.Scanner;

public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        final String S = sc.next();
        String[] ts = {"eraser", "erase", "dreamer", "dream"};
        System.out.println(judgeSEqualT(S, ts));
        sc.close();
    }

    public static String judgeSEqualT(String target, String[] strs) {
        for (String str : strs) {
            target = target.replace(str, "");
            if (target.length() == 0) {
                return "YES";
            } else {
                continue;
            }
        }
        return "NO";
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        final String S = sc.next();
        String[] ts = {"eraser", "erase", "dreamer", "dream"};
        System.out.println(judgeSEqualT(S, ts));
        sc.close();
    }

    public static String judgeSEqualT(String target, String[] strs) {
        for (String str : strs) {
            target = target.replace(str, "");
            if (target.length() == 0) {
                return "YES";
            } else {
                continue;
            }
        }
        return "NO";
    }
} Main public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        final String S = sc.next();
        String[] ts = {"eraser", "erase", "dreamer", "dream"};
        System.out.println(judgeSEqualT(S, ts));
        sc.close();
    } main {
        final Scanner sc = new Scanner(System.in);
        final String S = sc.next();
        String[] ts = {"eraser", "erase", "dreamer", "dream"};
        System.out.println(judgeSEqualT(S, ts));
        sc.close();
    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final String S = sc.next(); S sc.next() sc.next sc String[] ts = {"eraser", "erase", "dreamer", "dream"}; ts {"eraser", "erase", "dreamer", "dream"} "eraser" "erase" "dreamer" "dream" System.out.println(judgeSEqualT(S, ts)) System.out.println System.out System System.out judgeSEqualT(S, ts) judgeSEqualT S ts sc.close() sc.close sc final String[] args args public static String judgeSEqualT(String target, String[] strs) {
        for (String str : strs) {
            target = target.replace(str, "");
            if (target.length() == 0) {
                return "YES";
            } else {
                continue;
            }
        }
        return "NO";
    } judgeSEqualT {
        for (String str : strs) {
            target = target.replace(str, "");
            if (target.length() == 0) {
                return "YES";
            } else {
                continue;
            }
        }
        return "NO";
    } for (String str : strs) {
            target = target.replace(str, "");
            if (target.length() == 0) {
                return "YES";
            } else {
                continue;
            }
        } String str strs {
            target = target.replace(str, "");
            if (target.length() == 0) {
                return "YES";
            } else {
                continue;
            }
        } {
            target = target.replace(str, "");
            if (target.length() == 0) {
                return "YES";
            } else {
                continue;
            }
        } target = target.replace(str, "") target target.replace(str, "") target.replace target str "" if (target.length() == 0) {
                return "YES";
            } else {
                continue;
            } target.length() == 0 target.length() target.length target 0 {
                return "YES";
            } return "YES"; "YES" {
                continue;
            } continue; return "NO"; "NO" String target target String[] strs strs public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        final String S = sc.next();
        String[] ts = {"eraser", "erase", "dreamer", "dream"};
        System.out.println(judgeSEqualT(S, ts));
        sc.close();
    }

    public static String judgeSEqualT(String target, String[] strs) {
        for (String str : strs) {
            target = target.replace(str, "");
            if (target.length() == 0) {
                return "YES";
            } else {
                continue;
            }
        }
        return "NO";
    }
} public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        final String S = sc.next();
        String[] ts = {"eraser", "erase", "dreamer", "dream"};
        System.out.println(judgeSEqualT(S, ts));
        sc.close();
    }

    public static String judgeSEqualT(String target, String[] strs) {
        for (String str : strs) {
            target = target.replace(str, "");
            if (target.length() == 0) {
                return "YES";
            } else {
                continue;
            }
        }
        return "NO";
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        final String S = sc.next();
        String[] ts = {"eraser", "erase", "dreamer", "dream"};
        System.out.println(judgeSEqualT(S, ts));
        sc.close();
    }

    public static String judgeSEqualT(String target, String[] strs) {
        for (String str : strs) {
            target = target.replace(str, "");
            if (target.length() == 0) {
                return "YES";
            } else {
                continue;
            }
        }
        return "NO";
    }
}