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

public final class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String in = br.readLine();
		System.out.println(new Solver().solve(in));
	}
}

class Solver {

	String solve(String in) {
		HashMap<String, Boolean> m = new HashMap<String, Boolean>();
		m.put("dream", true);
		m.put("dreamer", true);
		m.put("erase", true);
		m.put("eraser", true);
		int i;
		for (i = 0; i < in.length() - 4;) {
			if (i + 4 < in.length() && m.containsKey(in.substring(i, i + 5))) {
				if (i + 6 < in.length() && m.containsKey(in.substring(i, i + 7))) {
					if (i + 9 < in.length() && m.containsKey(in.substring(i + 5, i + 10))) {
						i += 5;
					} else {
						i += 7;
					}
				} else if (i + 5 < in.length() && m.containsKey(in.substring(i, i + 6))) {
					i += 6;
				} else {
					i += 5;
				}
			} else {
				return "NO";
			}

		}
		return i >= in.length() ? "YES" : "NO";

	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.HashMap; HashMap java.util public final class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String in = br.readLine();
		System.out.println(new Solver().solve(in));
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String in = br.readLine();
		System.out.println(new Solver().solve(in));
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String in = br.readLine();
		System.out.println(new Solver().solve(in));
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String in = br.readLine(); in br.readLine() br.readLine br System.out.println(new Solver().solve(in)) System.out.println System.out System System.out new Solver().solve(in) new Solver().solve new Solver() in String[] args args class Solver {

	String solve(String in) {
		HashMap<String, Boolean> m = new HashMap<String, Boolean>();
		m.put("dream", true);
		m.put("dreamer", true);
		m.put("erase", true);
		m.put("eraser", true);
		int i;
		for (i = 0; i < in.length() - 4;) {
			if (i + 4 < in.length() && m.containsKey(in.substring(i, i + 5))) {
				if (i + 6 < in.length() && m.containsKey(in.substring(i, i + 7))) {
					if (i + 9 < in.length() && m.containsKey(in.substring(i + 5, i + 10))) {
						i += 5;
					} else {
						i += 7;
					}
				} else if (i + 5 < in.length() && m.containsKey(in.substring(i, i + 6))) {
					i += 6;
				} else {
					i += 5;
				}
			} else {
				return "NO";
			}

		}
		return i >= in.length() ? "YES" : "NO";

	}
} Solver String solve(String in) {
		HashMap<String, Boolean> m = new HashMap<String, Boolean>();
		m.put("dream", true);
		m.put("dreamer", true);
		m.put("erase", true);
		m.put("eraser", true);
		int i;
		for (i = 0; i < in.length() - 4;) {
			if (i + 4 < in.length() && m.containsKey(in.substring(i, i + 5))) {
				if (i + 6 < in.length() && m.containsKey(in.substring(i, i + 7))) {
					if (i + 9 < in.length() && m.containsKey(in.substring(i + 5, i + 10))) {
						i += 5;
					} else {
						i += 7;
					}
				} else if (i + 5 < in.length() && m.containsKey(in.substring(i, i + 6))) {
					i += 6;
				} else {
					i += 5;
				}
			} else {
				return "NO";
			}

		}
		return i >= in.length() ? "YES" : "NO";

	} solve {
		HashMap<String, Boolean> m = new HashMap<String, Boolean>();
		m.put("dream", true);
		m.put("dreamer", true);
		m.put("erase", true);
		m.put("eraser", true);
		int i;
		for (i = 0; i < in.length() - 4;) {
			if (i + 4 < in.length() && m.containsKey(in.substring(i, i + 5))) {
				if (i + 6 < in.length() && m.containsKey(in.substring(i, i + 7))) {
					if (i + 9 < in.length() && m.containsKey(in.substring(i + 5, i + 10))) {
						i += 5;
					} else {
						i += 7;
					}
				} else if (i + 5 < in.length() && m.containsKey(in.substring(i, i + 6))) {
					i += 6;
				} else {
					i += 5;
				}
			} else {
				return "NO";
			}

		}
		return i >= in.length() ? "YES" : "NO";

	} HashMap<String, Boolean> m = new HashMap<String, Boolean>(); m new HashMap<String, Boolean>() m.put("dream", true) m.put m "dream" true m.put("dreamer", true) m.put m "dreamer" true m.put("erase", true) m.put m "erase" true m.put("eraser", true) m.put m "eraser" true int i; i for (i = 0; i < in.length() - 4;) {
			if (i + 4 < in.length() && m.containsKey(in.substring(i, i + 5))) {
				if (i + 6 < in.length() && m.containsKey(in.substring(i, i + 7))) {
					if (i + 9 < in.length() && m.containsKey(in.substring(i + 5, i + 10))) {
						i += 5;
					} else {
						i += 7;
					}
				} else if (i + 5 < in.length() && m.containsKey(in.substring(i, i + 6))) {
					i += 6;
				} else {
					i += 5;
				}
			} else {
				return "NO";
			}

		} i = 0; i = 0 i 0 i < in.length() - 4 i in.length() - 4 in.length() in.length in 4 {
			if (i + 4 < in.length() && m.containsKey(in.substring(i, i + 5))) {
				if (i + 6 < in.length() && m.containsKey(in.substring(i, i + 7))) {
					if (i + 9 < in.length() && m.containsKey(in.substring(i + 5, i + 10))) {
						i += 5;
					} else {
						i += 7;
					}
				} else if (i + 5 < in.length() && m.containsKey(in.substring(i, i + 6))) {
					i += 6;
				} else {
					i += 5;
				}
			} else {
				return "NO";
			}

		} {
			if (i + 4 < in.length() && m.containsKey(in.substring(i, i + 5))) {
				if (i + 6 < in.length() && m.containsKey(in.substring(i, i + 7))) {
					if (i + 9 < in.length() && m.containsKey(in.substring(i + 5, i + 10))) {
						i += 5;
					} else {
						i += 7;
					}
				} else if (i + 5 < in.length() && m.containsKey(in.substring(i, i + 6))) {
					i += 6;
				} else {
					i += 5;
				}
			} else {
				return "NO";
			}

		} if (i + 4 < in.length() && m.containsKey(in.substring(i, i + 5))) {
				if (i + 6 < in.length() && m.containsKey(in.substring(i, i + 7))) {
					if (i + 9 < in.length() && m.containsKey(in.substring(i + 5, i + 10))) {
						i += 5;
					} else {
						i += 7;
					}
				} else if (i + 5 < in.length() && m.containsKey(in.substring(i, i + 6))) {
					i += 6;
				} else {
					i += 5;
				}
			} else {
				return "NO";
			} i + 4 < in.length() && m.containsKey(in.substring(i, i + 5)) i + 4 < in.length() i + 4 i 4 in.length() in.length in m.containsKey(in.substring(i, i + 5)) m.containsKey m in.substring(i, i + 5) in.substring in i i + 5 i 5 {
				if (i + 6 < in.length() && m.containsKey(in.substring(i, i + 7))) {
					if (i + 9 < in.length() && m.containsKey(in.substring(i + 5, i + 10))) {
						i += 5;
					} else {
						i += 7;
					}
				} else if (i + 5 < in.length() && m.containsKey(in.substring(i, i + 6))) {
					i += 6;
				} else {
					i += 5;
				}
			} if (i + 6 < in.length() && m.containsKey(in.substring(i, i + 7))) {
					if (i + 9 < in.length() && m.containsKey(in.substring(i + 5, i + 10))) {
						i += 5;
					} else {
						i += 7;
					}
				} else if (i + 5 < in.length() && m.containsKey(in.substring(i, i + 6))) {
					i += 6;
				} else {
					i += 5;
				} i + 6 < in.length() && m.containsKey(in.substring(i, i + 7)) i + 6 < in.length() i + 6 i 6 in.length() in.length in m.containsKey(in.substring(i, i + 7)) m.containsKey m in.substring(i, i + 7) in.substring in i i + 7 i 7 {
					if (i + 9 < in.length() && m.containsKey(in.substring(i + 5, i + 10))) {
						i += 5;
					} else {
						i += 7;
					}
				} if (i + 9 < in.length() && m.containsKey(in.substring(i + 5, i + 10))) {
						i += 5;
					} else {
						i += 7;
					} i + 9 < in.length() && m.containsKey(in.substring(i + 5, i + 10)) i + 9 < in.length() i + 9 i 9 in.length() in.length in m.containsKey(in.substring(i + 5, i + 10)) m.containsKey m in.substring(i + 5, i + 10) in.substring in i + 5 i 5 i + 10 i 10 {
						i += 5;
					} i += 5 i 5 {
						i += 7;
					} i += 7 i 7 if (i + 5 < in.length() && m.containsKey(in.substring(i, i + 6))) {
					i += 6;
				} else {
					i += 5;
				} i + 5 < in.length() && m.containsKey(in.substring(i, i + 6)) i + 5 < in.length() i + 5 i 5 in.length() in.length in m.containsKey(in.substring(i, i + 6)) m.containsKey m in.substring(i, i + 6) in.substring in i i + 6 i 6 {
					i += 6;
				} i += 6 i 6 {
					i += 5;
				} i += 5 i 5 {
				return "NO";
			} return "NO"; "NO" return i >= in.length() ? "YES" : "NO"; i >= in.length() ? "YES" : "NO" i >= in.length() i in.length() in.length in "YES" "NO" String in in public final class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String in = br.readLine();
		System.out.println(new Solver().solve(in));
	}
} public final class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String in = br.readLine();
		System.out.println(new Solver().solve(in));
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;

public final class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String in = br.readLine();
		System.out.println(new Solver().solve(in));
	}
}

class Solver {

	String solve(String in) {
		HashMap<String, Boolean> m = new HashMap<String, Boolean>();
		m.put("dream", true);
		m.put("dreamer", true);
		m.put("erase", true);
		m.put("eraser", true);
		int i;
		for (i = 0; i < in.length() - 4;) {
			if (i + 4 < in.length() && m.containsKey(in.substring(i, i + 5))) {
				if (i + 6 < in.length() && m.containsKey(in.substring(i, i + 7))) {
					if (i + 9 < in.length() && m.containsKey(in.substring(i + 5, i + 10))) {
						i += 5;
					} else {
						i += 7;
					}
				} else if (i + 5 < in.length() && m.containsKey(in.substring(i, i + 6))) {
					i += 6;
				} else {
					i += 5;
				}
			} else {
				return "NO";
			}

		}
		return i >= in.length() ? "YES" : "NO";

	}
}
