import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            String S = in.next();

            String[] s = new String[] { "dream", "dreamer", "erase", "eraser", };

            for (int index = S.length(); index > 0;) {
                String match = find(S, index, s);

                if (match == null) {
                    System.out.println("NO");
                    return;
                }

                index -= match.length();
            }

            System.out.println("YES");
        }
    }

    private static String find(String S, int index, String[] s) {
        for (String dream : s) {
            if (S.substring(0, index).endsWith(dream)) {
                return dream;
            }
        }
        return null;
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            String S = in.next();

            String[] s = new String[] { "dream", "dreamer", "erase", "eraser", };

            for (int index = S.length(); index > 0;) {
                String match = find(S, index, s);

                if (match == null) {
                    System.out.println("NO");
                    return;
                }

                index -= match.length();
            }

            System.out.println("YES");
        }
    }

    private static String find(String S, int index, String[] s) {
        for (String dream : s) {
            if (S.substring(0, index).endsWith(dream)) {
                return dream;
            }
        }
        return null;
    }
} Main public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            String S = in.next();

            String[] s = new String[] { "dream", "dreamer", "erase", "eraser", };

            for (int index = S.length(); index > 0;) {
                String match = find(S, index, s);

                if (match == null) {
                    System.out.println("NO");
                    return;
                }

                index -= match.length();
            }

            System.out.println("YES");
        }
    } main {
        try (Scanner in = new Scanner(System.in)) {
            String S = in.next();

            String[] s = new String[] { "dream", "dreamer", "erase", "eraser", };

            for (int index = S.length(); index > 0;) {
                String match = find(S, index, s);

                if (match == null) {
                    System.out.println("NO");
                    return;
                }

                index -= match.length();
            }

            System.out.println("YES");
        }
    } try (Scanner in = new Scanner(System.in)) {
            String S = in.next();

            String[] s = new String[] { "dream", "dreamer", "erase", "eraser", };

            for (int index = S.length(); index > 0;) {
                String match = find(S, index, s);

                if (match == null) {
                    System.out.println("NO");
                    return;
                }

                index -= match.length();
            }

            System.out.println("YES");
        } {
            String S = in.next();

            String[] s = new String[] { "dream", "dreamer", "erase", "eraser", };

            for (int index = S.length(); index > 0;) {
                String match = find(S, index, s);

                if (match == null) {
                    System.out.println("NO");
                    return;
                }

                index -= match.length();
            }

            System.out.println("YES");
        } Scanner in = new Scanner(System.in) Scanner in = new Scanner(System.in) new Scanner(System.in) String S = in.next(); S in.next() in.next in String[] s = new String[] { "dream", "dreamer", "erase", "eraser", }; s new String[] { "dream", "dreamer", "erase", "eraser", } for (int index = S.length(); index > 0;) {
                String match = find(S, index, s);

                if (match == null) {
                    System.out.println("NO");
                    return;
                }

                index -= match.length();
            } int index = S.length(); int index = S.length(); index S.length() S.length S index > 0 index 0 {
                String match = find(S, index, s);

                if (match == null) {
                    System.out.println("NO");
                    return;
                }

                index -= match.length();
            } {
                String match = find(S, index, s);

                if (match == null) {
                    System.out.println("NO");
                    return;
                }

                index -= match.length();
            } String match = find(S, index, s); match find(S, index, s) find S index s if (match == null) {
                    System.out.println("NO");
                    return;
                } match == null match null {
                    System.out.println("NO");
                    return;
                } System.out.println("NO") System.out.println System.out System System.out "NO" return; index -= match.length() index match.length() match.length match System.out.println("YES") System.out.println System.out System System.out "YES" String[] args args private static String find(String S, int index, String[] s) {
        for (String dream : s) {
            if (S.substring(0, index).endsWith(dream)) {
                return dream;
            }
        }
        return null;
    } find {
        for (String dream : s) {
            if (S.substring(0, index).endsWith(dream)) {
                return dream;
            }
        }
        return null;
    } for (String dream : s) {
            if (S.substring(0, index).endsWith(dream)) {
                return dream;
            }
        } String dream s {
            if (S.substring(0, index).endsWith(dream)) {
                return dream;
            }
        } {
            if (S.substring(0, index).endsWith(dream)) {
                return dream;
            }
        } if (S.substring(0, index).endsWith(dream)) {
                return dream;
            } S.substring(0, index).endsWith(dream) S.substring(0, index).endsWith S.substring(0, index) S.substring S 0 index dream {
                return dream;
            } return dream; dream return null; null String S S int index index String[] s s public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            String S = in.next();

            String[] s = new String[] { "dream", "dreamer", "erase", "eraser", };

            for (int index = S.length(); index > 0;) {
                String match = find(S, index, s);

                if (match == null) {
                    System.out.println("NO");
                    return;
                }

                index -= match.length();
            }

            System.out.println("YES");
        }
    }

    private static String find(String S, int index, String[] s) {
        for (String dream : s) {
            if (S.substring(0, index).endsWith(dream)) {
                return dream;
            }
        }
        return null;
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            String S = in.next();

            String[] s = new String[] { "dream", "dreamer", "erase", "eraser", };

            for (int index = S.length(); index > 0;) {
                String match = find(S, index, s);

                if (match == null) {
                    System.out.println("NO");
                    return;
                }

                index -= match.length();
            }

            System.out.println("YES");
        }
    }

    private static String find(String S, int index, String[] s) {
        for (String dream : s) {
            if (S.substring(0, index).endsWith(dream)) {
                return dream;
            }
        }
        return null;
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            String S = in.next();

            String[] s = new String[] { "dream", "dreamer", "erase", "eraser", };

            for (int index = S.length(); index > 0;) {
                String match = find(S, index, s);

                if (match == null) {
                    System.out.println("NO");
                    return;
                }

                index -= match.length();
            }

            System.out.println("YES");
        }
    }

    private static String find(String S, int index, String[] s) {
        for (String dream : s) {
            if (S.substring(0, index).endsWith(dream)) {
                return dream;
            }
        }
        return null;
    }
}
