import java.util.Arrays;
import java.util.Scanner;

class Main {
	String s;
	String[] d = { "dream", "dreamer", "erase", "eraser" };

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Main m = new Main(sc);
		m.solve();
		sc.close();
	}

	Main(Scanner sc) {
		s = sc.next();
	}

	void solve() {
		boolean[] dp = new boolean[s.length()+1];
		Arrays.fill(dp, false);
		dp[0] = true;
		for(int i=0;i<s.length();i++){
			if(dp[i]){
				for(int j=0;j<4;j++){
					if(i+d[j].length()<=s.length()){
						if(d[j].equals(s.substring(i,i+d[j].length()))){
							dp[i+d[j].length()] = true;
						}
					}
				}
			}
		}
		if(dp[s.length()]){
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util class Main {
	String s;
	String[] d = { "dream", "dreamer", "erase", "eraser" };

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Main m = new Main(sc);
		m.solve();
		sc.close();
	}

	Main(Scanner sc) {
		s = sc.next();
	}

	void solve() {
		boolean[] dp = new boolean[s.length()+1];
		Arrays.fill(dp, false);
		dp[0] = true;
		for(int i=0;i<s.length();i++){
			if(dp[i]){
				for(int j=0;j<4;j++){
					if(i+d[j].length()<=s.length()){
						if(d[j].equals(s.substring(i,i+d[j].length()))){
							dp[i+d[j].length()] = true;
						}
					}
				}
			}
		}
		if(dp[s.length()]){
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
} Main String s; s String[] d = { "dream", "dreamer", "erase", "eraser" }; d { "dream", "dreamer", "erase", "eraser" } "dream" "dreamer" "erase" "eraser" public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Main m = new Main(sc);
		m.solve();
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		Main m = new Main(sc);
		m.solve();
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Main m = new Main(sc); m new Main(sc) m.solve() m.solve m sc.close() sc.close sc String[] args args Main(Scanner sc) {
		s = sc.next();
	} Main {
		s = sc.next();
	} s = sc.next() s sc.next() sc.next sc Scanner sc sc void solve() {
		boolean[] dp = new boolean[s.length()+1];
		Arrays.fill(dp, false);
		dp[0] = true;
		for(int i=0;i<s.length();i++){
			if(dp[i]){
				for(int j=0;j<4;j++){
					if(i+d[j].length()<=s.length()){
						if(d[j].equals(s.substring(i,i+d[j].length()))){
							dp[i+d[j].length()] = true;
						}
					}
				}
			}
		}
		if(dp[s.length()]){
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	} solve {
		boolean[] dp = new boolean[s.length()+1];
		Arrays.fill(dp, false);
		dp[0] = true;
		for(int i=0;i<s.length();i++){
			if(dp[i]){
				for(int j=0;j<4;j++){
					if(i+d[j].length()<=s.length()){
						if(d[j].equals(s.substring(i,i+d[j].length()))){
							dp[i+d[j].length()] = true;
						}
					}
				}
			}
		}
		if(dp[s.length()]){
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	} boolean[] dp = new boolean[s.length()+1]; dp new boolean[s.length()+1] s.length()+1 s.length() s.length s 1 Arrays.fill(dp, false) Arrays.fill Arrays dp false dp[0] = true dp[0] dp 0 true for(int i=0;i<s.length();i++){
			if(dp[i]){
				for(int j=0;j<4;j++){
					if(i+d[j].length()<=s.length()){
						if(d[j].equals(s.substring(i,i+d[j].length()))){
							dp[i+d[j].length()] = true;
						}
					}
				}
			}
		} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			if(dp[i]){
				for(int j=0;j<4;j++){
					if(i+d[j].length()<=s.length()){
						if(d[j].equals(s.substring(i,i+d[j].length()))){
							dp[i+d[j].length()] = true;
						}
					}
				}
			}
		} {
			if(dp[i]){
				for(int j=0;j<4;j++){
					if(i+d[j].length()<=s.length()){
						if(d[j].equals(s.substring(i,i+d[j].length()))){
							dp[i+d[j].length()] = true;
						}
					}
				}
			}
		} if(dp[i]){
				for(int j=0;j<4;j++){
					if(i+d[j].length()<=s.length()){
						if(d[j].equals(s.substring(i,i+d[j].length()))){
							dp[i+d[j].length()] = true;
						}
					}
				}
			} dp[i] dp i {
				for(int j=0;j<4;j++){
					if(i+d[j].length()<=s.length()){
						if(d[j].equals(s.substring(i,i+d[j].length()))){
							dp[i+d[j].length()] = true;
						}
					}
				}
			} for(int j=0;j<4;j++){
					if(i+d[j].length()<=s.length()){
						if(d[j].equals(s.substring(i,i+d[j].length()))){
							dp[i+d[j].length()] = true;
						}
					}
				} int j=0; int j=0; j 0 j<4 j 4 j++ j++ j {
					if(i+d[j].length()<=s.length()){
						if(d[j].equals(s.substring(i,i+d[j].length()))){
							dp[i+d[j].length()] = true;
						}
					}
				} {
					if(i+d[j].length()<=s.length()){
						if(d[j].equals(s.substring(i,i+d[j].length()))){
							dp[i+d[j].length()] = true;
						}
					}
				} if(i+d[j].length()<=s.length()){
						if(d[j].equals(s.substring(i,i+d[j].length()))){
							dp[i+d[j].length()] = true;
						}
					} i+d[j].length()<=s.length() i+d[j].length() i d[j].length() d[j].length d[j] d j s.length() s.length s {
						if(d[j].equals(s.substring(i,i+d[j].length()))){
							dp[i+d[j].length()] = true;
						}
					} if(d[j].equals(s.substring(i,i+d[j].length()))){
							dp[i+d[j].length()] = true;
						} d[j].equals(s.substring(i,i+d[j].length())) d[j].equals d[j] d j s.substring(i,i+d[j].length()) s.substring s i i+d[j].length() i d[j].length() d[j].length d[j] d j {
							dp[i+d[j].length()] = true;
						} dp[i+d[j].length()] = true dp[i+d[j].length()] dp i+d[j].length() i d[j].length() d[j].length d[j] d j true if(dp[s.length()]){
			System.out.println("YES");
		} else {
			System.out.println("NO");
		} dp[s.length()] dp s.length() s.length s {
			System.out.println("YES");
		} System.out.println("YES") System.out.println System.out System System.out "YES" {
			System.out.println("NO");
		} System.out.println("NO") System.out.println System.out System System.out "NO"
import java.util.Arrays;
import java.util.Scanner;

class Main {
	String s;
	String[] d = { "dream", "dreamer", "erase", "eraser" };

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Main m = new Main(sc);
		m.solve();
		sc.close();
	}

	Main(Scanner sc) {
		s = sc.next();
	}

	void solve() {
		boolean[] dp = new boolean[s.length()+1];
		Arrays.fill(dp, false);
		dp[0] = true;
		for(int i=0;i<s.length();i++){
			if(dp[i]){
				for(int j=0;j<4;j++){
					if(i+d[j].length()<=s.length()){
						if(d[j].equals(s.substring(i,i+d[j].length()))){
							dp[i+d[j].length()] = true;
						}
					}
				}
			}
		}
		if(dp[s.length()]){
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
}