import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Main implements Runnable {

    private void solve() throws IOException {

        String[] all = new String[] {
                "dream",
                "dreamer",
                "erase",
                "eraser"
        };
        String s = reader.readLine();
        boolean[] dp = new boolean[s.length() + 2];
        dp[0] = true;
        for(int i = 1; i <= s.length(); ++i) {

            for(int j = 0; j < all.length; ++j) {

                if(i >= all[j].length()) {
                    if(i == all[j].length()) {
                        boolean can = true;
                        for(int z = 0; z < i; ++z) {
                            can &= (all[j].charAt(z) == s.charAt(z));
                        }
                        if(can) {
                            dp[i] = true;

                        }
                    } else {
                        if(dp[i-all[j].length()]) {
                            boolean can = true;
                            int id = 0;
                            for(int z = 0; z < all[j].length(); ++z) {
                                can &= ( all[j].charAt(z) == s.charAt(i-all[j].length() + id));
                                ++id;
                            }
                            if(can) dp[i] = true;
                        }
                    }
                }
            }
        }
        if(dp[s.length()]) writer.println("YES");
        else writer.println("NO");


    }



    public static void main(String[] args) {
        new Main().run();
    }

    BufferedReader reader;
    //    BufferedReader reader2;
    StringTokenizer tokenizer;
    PrintWriter writer;
    //    BufferedWriter writer;

    public void run() {
        try {
            reader = new BufferedReader(new InputStreamReader(System.in));
//            reader = new BufferedReader(new FileReader("trees.in"));
            //            reader2 = new BufferedReader(new FileReader("1.in"));
            tokenizer = null;
            writer = new PrintWriter(System.out);
//            writer = new     PrintWriter("trees.out");
//                                                    writer = new BufferedWriter(System.out);
            //                        writer = new BufferedWriter(new OutputStreamWriter(System.out));
            solve();
            reader.close();
            //            reader2.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    short nextShort() throws IOException {
        return Short.parseShort(nextToken());
    }

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }

        return tokenizer.nextToken();
    }

}

Measured memory_bytes: 11344