import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String s = br.readLine();
		String str[] = s.split("");

		int now = str.length;
		for (int i = str.length; i >= 1;) {
			if (i - 7 >= 0) {
				String ss = s.substring(i - 7, i);
				if (ss.equals("dreamer")) {
					i -= 7;
					now = i;
					continue;
				}
			}
			if (i - 6 >= 0) {
				String ss = s.substring(i - 6, i);
				if (ss.equals("eraser")) {
					i -= 6;
					now = i;
					continue;
				}
			}
			if (i - 5 >= 0) {
				String ss = s.substring(i - 5, i);
				if (ss.equals("dream") || ss.equals("erase")) {
					i -= 5;
					now = i;
					continue;
				}
			}
			if (now == i) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String s = br.readLine();
		String str[] = s.split("");

		int now = str.length;
		for (int i = str.length; i >= 1;) {
			if (i - 7 >= 0) {
				String ss = s.substring(i - 7, i);
				if (ss.equals("dreamer")) {
					i -= 7;
					now = i;
					continue;
				}
			}
			if (i - 6 >= 0) {
				String ss = s.substring(i - 6, i);
				if (ss.equals("eraser")) {
					i -= 6;
					now = i;
					continue;
				}
			}
			if (i - 5 >= 0) {
				String ss = s.substring(i - 5, i);
				if (ss.equals("dream") || ss.equals("erase")) {
					i -= 5;
					now = i;
					continue;
				}
			}
			if (now == i) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String s = br.readLine();
		String str[] = s.split("");

		int now = str.length;
		for (int i = str.length; i >= 1;) {
			if (i - 7 >= 0) {
				String ss = s.substring(i - 7, i);
				if (ss.equals("dreamer")) {
					i -= 7;
					now = i;
					continue;
				}
			}
			if (i - 6 >= 0) {
				String ss = s.substring(i - 6, i);
				if (ss.equals("eraser")) {
					i -= 6;
					now = i;
					continue;
				}
			}
			if (i - 5 >= 0) {
				String ss = s.substring(i - 5, i);
				if (ss.equals("dream") || ss.equals("erase")) {
					i -= 5;
					now = i;
					continue;
				}
			}
			if (now == i) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String s = br.readLine();
		String str[] = s.split("");

		int now = str.length;
		for (int i = str.length; i >= 1;) {
			if (i - 7 >= 0) {
				String ss = s.substring(i - 7, i);
				if (ss.equals("dreamer")) {
					i -= 7;
					now = i;
					continue;
				}
			}
			if (i - 6 >= 0) {
				String ss = s.substring(i - 6, i);
				if (ss.equals("eraser")) {
					i -= 6;
					now = i;
					continue;
				}
			}
			if (i - 5 >= 0) {
				String ss = s.substring(i - 5, i);
				if (ss.equals("dream") || ss.equals("erase")) {
					i -= 5;
					now = i;
					continue;
				}
			}
			if (now == i) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String s = br.readLine(); s br.readLine() br.readLine br String str[] = s.split(""); str s.split("") s.split s "" int now = str.length; now str.length str str.length for (int i = str.length; i >= 1;) {
			if (i - 7 >= 0) {
				String ss = s.substring(i - 7, i);
				if (ss.equals("dreamer")) {
					i -= 7;
					now = i;
					continue;
				}
			}
			if (i - 6 >= 0) {
				String ss = s.substring(i - 6, i);
				if (ss.equals("eraser")) {
					i -= 6;
					now = i;
					continue;
				}
			}
			if (i - 5 >= 0) {
				String ss = s.substring(i - 5, i);
				if (ss.equals("dream") || ss.equals("erase")) {
					i -= 5;
					now = i;
					continue;
				}
			}
			if (now == i) {
				System.out.println("NO");
				return;
			}
		} int i = str.length; int i = str.length; i str.length str str.length i >= 1 i 1 {
			if (i - 7 >= 0) {
				String ss = s.substring(i - 7, i);
				if (ss.equals("dreamer")) {
					i -= 7;
					now = i;
					continue;
				}
			}
			if (i - 6 >= 0) {
				String ss = s.substring(i - 6, i);
				if (ss.equals("eraser")) {
					i -= 6;
					now = i;
					continue;
				}
			}
			if (i - 5 >= 0) {
				String ss = s.substring(i - 5, i);
				if (ss.equals("dream") || ss.equals("erase")) {
					i -= 5;
					now = i;
					continue;
				}
			}
			if (now == i) {
				System.out.println("NO");
				return;
			}
		} {
			if (i - 7 >= 0) {
				String ss = s.substring(i - 7, i);
				if (ss.equals("dreamer")) {
					i -= 7;
					now = i;
					continue;
				}
			}
			if (i - 6 >= 0) {
				String ss = s.substring(i - 6, i);
				if (ss.equals("eraser")) {
					i -= 6;
					now = i;
					continue;
				}
			}
			if (i - 5 >= 0) {
				String ss = s.substring(i - 5, i);
				if (ss.equals("dream") || ss.equals("erase")) {
					i -= 5;
					now = i;
					continue;
				}
			}
			if (now == i) {
				System.out.println("NO");
				return;
			}
		} if (i - 7 >= 0) {
				String ss = s.substring(i - 7, i);
				if (ss.equals("dreamer")) {
					i -= 7;
					now = i;
					continue;
				}
			} i - 7 >= 0 i - 7 i 7 0 {
				String ss = s.substring(i - 7, i);
				if (ss.equals("dreamer")) {
					i -= 7;
					now = i;
					continue;
				}
			} String ss = s.substring(i - 7, i); ss s.substring(i - 7, i) s.substring s i - 7 i 7 i if (ss.equals("dreamer")) {
					i -= 7;
					now = i;
					continue;
				} ss.equals("dreamer") ss.equals ss "dreamer" {
					i -= 7;
					now = i;
					continue;
				} i -= 7 i 7 now = i now i continue; if (i - 6 >= 0) {
				String ss = s.substring(i - 6, i);
				if (ss.equals("eraser")) {
					i -= 6;
					now = i;
					continue;
				}
			} i - 6 >= 0 i - 6 i 6 0 {
				String ss = s.substring(i - 6, i);
				if (ss.equals("eraser")) {
					i -= 6;
					now = i;
					continue;
				}
			} String ss = s.substring(i - 6, i); ss s.substring(i - 6, i) s.substring s i - 6 i 6 i if (ss.equals("eraser")) {
					i -= 6;
					now = i;
					continue;
				} ss.equals("eraser") ss.equals ss "eraser" {
					i -= 6;
					now = i;
					continue;
				} i -= 6 i 6 now = i now i continue; if (i - 5 >= 0) {
				String ss = s.substring(i - 5, i);
				if (ss.equals("dream") || ss.equals("erase")) {
					i -= 5;
					now = i;
					continue;
				}
			} i - 5 >= 0 i - 5 i 5 0 {
				String ss = s.substring(i - 5, i);
				if (ss.equals("dream") || ss.equals("erase")) {
					i -= 5;
					now = i;
					continue;
				}
			} String ss = s.substring(i - 5, i); ss s.substring(i - 5, i) s.substring s i - 5 i 5 i if (ss.equals("dream") || ss.equals("erase")) {
					i -= 5;
					now = i;
					continue;
				} ss.equals("dream") || ss.equals("erase") ss.equals("dream") ss.equals ss "dream" ss.equals("erase") ss.equals ss "erase" {
					i -= 5;
					now = i;
					continue;
				} i -= 5 i 5 now = i now i continue; if (now == i) {
				System.out.println("NO");
				return;
			} now == i now i {
				System.out.println("NO");
				return;
			} System.out.println("NO") System.out.println System.out System System.out "NO" return; System.out.println("YES") System.out.println System.out System System.out "YES" String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String s = br.readLine();
		String str[] = s.split("");

		int now = str.length;
		for (int i = str.length; i >= 1;) {
			if (i - 7 >= 0) {
				String ss = s.substring(i - 7, i);
				if (ss.equals("dreamer")) {
					i -= 7;
					now = i;
					continue;
				}
			}
			if (i - 6 >= 0) {
				String ss = s.substring(i - 6, i);
				if (ss.equals("eraser")) {
					i -= 6;
					now = i;
					continue;
				}
			}
			if (i - 5 >= 0) {
				String ss = s.substring(i - 5, i);
				if (ss.equals("dream") || ss.equals("erase")) {
					i -= 5;
					now = i;
					continue;
				}
			}
			if (now == i) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}
} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String s = br.readLine();
		String str[] = s.split("");

		int now = str.length;
		for (int i = str.length; i >= 1;) {
			if (i - 7 >= 0) {
				String ss = s.substring(i - 7, i);
				if (ss.equals("dreamer")) {
					i -= 7;
					now = i;
					continue;
				}
			}
			if (i - 6 >= 0) {
				String ss = s.substring(i - 6, i);
				if (ss.equals("eraser")) {
					i -= 6;
					now = i;
					continue;
				}
			}
			if (i - 5 >= 0) {
				String ss = s.substring(i - 5, i);
				if (ss.equals("dream") || ss.equals("erase")) {
					i -= 5;
					now = i;
					continue;
				}
			}
			if (now == i) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String s = br.readLine();
		String str[] = s.split("");

		int now = str.length;
		for (int i = str.length; i >= 1;) {
			if (i - 7 >= 0) {
				String ss = s.substring(i - 7, i);
				if (ss.equals("dreamer")) {
					i -= 7;
					now = i;
					continue;
				}
			}
			if (i - 6 >= 0) {
				String ss = s.substring(i - 6, i);
				if (ss.equals("eraser")) {
					i -= 6;
					now = i;
					continue;
				}
			}
			if (i - 5 >= 0) {
				String ss = s.substring(i - 5, i);
				if (ss.equals("dream") || ss.equals("erase")) {
					i -= 5;
					now = i;
					continue;
				}
			}
			if (now == i) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}
}
