import java.util.Scanner;

public class Main {
	char[] c;
	int[] dp;
	char[][] w = { "dream".toCharArray(),
			"dreamer".toCharArray(),
			"erase".toCharArray(),
			"eraser".toCharArray() };

	int dp(int k) {
		if (c.length <= k) {
			return 1;
		}
		if (dp[k] != 0) {
			return dp[k];
		}

		int ret = -1;
		for (int i = 0; i < 4; i++) {
			if (check(k, i)) {
				ret = Math.max(ret, dp(k + w[i].length));
			}
		}

		return dp[k] = ret;
	}

	boolean check(int i, int k) {
		for (int j = 0; j < w[k].length; j++) {
			if (c.length <= i + j) {
				return false;
			}
			if (c[i + j] != w[k][j]) {
				return false;
			}
		}
		return true;
	}

	void run() {
		Scanner sc = new Scanner(System.in);

		c = sc.next().toCharArray();
		dp = new int[c.length];
		System.out.println(dp(0) == 1 ? "YES" : "NO");
	}

	public static void main(String[] args) {
		new Main().run();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	char[] c;
	int[] dp;
	char[][] w = { "dream".toCharArray(),
			"dreamer".toCharArray(),
			"erase".toCharArray(),
			"eraser".toCharArray() };

	int dp(int k) {
		if (c.length <= k) {
			return 1;
		}
		if (dp[k] != 0) {
			return dp[k];
		}

		int ret = -1;
		for (int i = 0; i < 4; i++) {
			if (check(k, i)) {
				ret = Math.max(ret, dp(k + w[i].length));
			}
		}

		return dp[k] = ret;
	}

	boolean check(int i, int k) {
		for (int j = 0; j < w[k].length; j++) {
			if (c.length <= i + j) {
				return false;
			}
			if (c[i + j] != w[k][j]) {
				return false;
			}
		}
		return true;
	}

	void run() {
		Scanner sc = new Scanner(System.in);

		c = sc.next().toCharArray();
		dp = new int[c.length];
		System.out.println(dp(0) == 1 ? "YES" : "NO");
	}

	public static void main(String[] args) {
		new Main().run();
	}
} Main char[] c; c int[] dp; dp char[][] w = { "dream".toCharArray(),
			"dreamer".toCharArray(),
			"erase".toCharArray(),
			"eraser".toCharArray() }; w { "dream".toCharArray(),
			"dreamer".toCharArray(),
			"erase".toCharArray(),
			"eraser".toCharArray() } "dream".toCharArray() "dream".toCharArray "dream" "dreamer".toCharArray() "dreamer".toCharArray "dreamer" "erase".toCharArray() "erase".toCharArray "erase" "eraser".toCharArray() "eraser".toCharArray "eraser" int dp(int k) {
		if (c.length <= k) {
			return 1;
		}
		if (dp[k] != 0) {
			return dp[k];
		}

		int ret = -1;
		for (int i = 0; i < 4; i++) {
			if (check(k, i)) {
				ret = Math.max(ret, dp(k + w[i].length));
			}
		}

		return dp[k] = ret;
	} dp {
		if (c.length <= k) {
			return 1;
		}
		if (dp[k] != 0) {
			return dp[k];
		}

		int ret = -1;
		for (int i = 0; i < 4; i++) {
			if (check(k, i)) {
				ret = Math.max(ret, dp(k + w[i].length));
			}
		}

		return dp[k] = ret;
	} if (c.length <= k) {
			return 1;
		} c.length <= k c.length c c.length k {
			return 1;
		} return 1; 1 if (dp[k] != 0) {
			return dp[k];
		} dp[k] != 0 dp[k] dp k 0 {
			return dp[k];
		} return dp[k]; dp[k] dp k int ret = -1; ret -1 1 for (int i = 0; i < 4; i++) {
			if (check(k, i)) {
				ret = Math.max(ret, dp(k + w[i].length));
			}
		} int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
			if (check(k, i)) {
				ret = Math.max(ret, dp(k + w[i].length));
			}
		} {
			if (check(k, i)) {
				ret = Math.max(ret, dp(k + w[i].length));
			}
		} if (check(k, i)) {
				ret = Math.max(ret, dp(k + w[i].length));
			} check(k, i) check k i {
				ret = Math.max(ret, dp(k + w[i].length));
			} ret = Math.max(ret, dp(k + w[i].length)) ret Math.max(ret, dp(k + w[i].length)) Math.max Math ret dp(k + w[i].length) dp k + w[i].length k w[i].length w[i] w i w[i].length return dp[k] = ret; dp[k] = ret dp[k] dp k ret int k k boolean check(int i, int k) {
		for (int j = 0; j < w[k].length; j++) {
			if (c.length <= i + j) {
				return false;
			}
			if (c[i + j] != w[k][j]) {
				return false;
			}
		}
		return true;
	} check {
		for (int j = 0; j < w[k].length; j++) {
			if (c.length <= i + j) {
				return false;
			}
			if (c[i + j] != w[k][j]) {
				return false;
			}
		}
		return true;
	} for (int j = 0; j < w[k].length; j++) {
			if (c.length <= i + j) {
				return false;
			}
			if (c[i + j] != w[k][j]) {
				return false;
			}
		} int j = 0; int j = 0; j 0 j < w[k].length j w[k].length w[k] w k w[k].length j++ j++ j {
			if (c.length <= i + j) {
				return false;
			}
			if (c[i + j] != w[k][j]) {
				return false;
			}
		} {
			if (c.length <= i + j) {
				return false;
			}
			if (c[i + j] != w[k][j]) {
				return false;
			}
		} if (c.length <= i + j) {
				return false;
			} c.length <= i + j c.length c c.length i + j i j {
				return false;
			} return false; false if (c[i + j] != w[k][j]) {
				return false;
			} c[i + j] != w[k][j] c[i + j] c i + j i j w[k][j] w[k] w k j {
				return false;
			} return false; false return true; true int i i int k k void run() {
		Scanner sc = new Scanner(System.in);

		c = sc.next().toCharArray();
		dp = new int[c.length];
		System.out.println(dp(0) == 1 ? "YES" : "NO");
	} run {
		Scanner sc = new Scanner(System.in);

		c = sc.next().toCharArray();
		dp = new int[c.length];
		System.out.println(dp(0) == 1 ? "YES" : "NO");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) c = sc.next().toCharArray() c sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc dp = new int[c.length] dp new int[c.length] c.length c c.length System.out.println(dp(0) == 1 ? "YES" : "NO") System.out.println System.out System System.out dp(0) == 1 ? "YES" : "NO" dp(0) == 1 dp(0) dp 0 1 "YES" "NO" public static void main(String[] args) {
		new Main().run();
	} main {
		new Main().run();
	} new Main().run() new Main().run new Main() String[] args args public class Main {
	char[] c;
	int[] dp;
	char[][] w = { "dream".toCharArray(),
			"dreamer".toCharArray(),
			"erase".toCharArray(),
			"eraser".toCharArray() };

	int dp(int k) {
		if (c.length <= k) {
			return 1;
		}
		if (dp[k] != 0) {
			return dp[k];
		}

		int ret = -1;
		for (int i = 0; i < 4; i++) {
			if (check(k, i)) {
				ret = Math.max(ret, dp(k + w[i].length));
			}
		}

		return dp[k] = ret;
	}

	boolean check(int i, int k) {
		for (int j = 0; j < w[k].length; j++) {
			if (c.length <= i + j) {
				return false;
			}
			if (c[i + j] != w[k][j]) {
				return false;
			}
		}
		return true;
	}

	void run() {
		Scanner sc = new Scanner(System.in);

		c = sc.next().toCharArray();
		dp = new int[c.length];
		System.out.println(dp(0) == 1 ? "YES" : "NO");
	}

	public static void main(String[] args) {
		new Main().run();
	}
} public class Main {
	char[] c;
	int[] dp;
	char[][] w = { "dream".toCharArray(),
			"dreamer".toCharArray(),
			"erase".toCharArray(),
			"eraser".toCharArray() };

	int dp(int k) {
		if (c.length <= k) {
			return 1;
		}
		if (dp[k] != 0) {
			return dp[k];
		}

		int ret = -1;
		for (int i = 0; i < 4; i++) {
			if (check(k, i)) {
				ret = Math.max(ret, dp(k + w[i].length));
			}
		}

		return dp[k] = ret;
	}

	boolean check(int i, int k) {
		for (int j = 0; j < w[k].length; j++) {
			if (c.length <= i + j) {
				return false;
			}
			if (c[i + j] != w[k][j]) {
				return false;
			}
		}
		return true;
	}

	void run() {
		Scanner sc = new Scanner(System.in);

		c = sc.next().toCharArray();
		dp = new int[c.length];
		System.out.println(dp(0) == 1 ? "YES" : "NO");
	}

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

public class Main {
	char[] c;
	int[] dp;
	char[][] w = { "dream".toCharArray(),
			"dreamer".toCharArray(),
			"erase".toCharArray(),
			"eraser".toCharArray() };

	int dp(int k) {
		if (c.length <= k) {
			return 1;
		}
		if (dp[k] != 0) {
			return dp[k];
		}

		int ret = -1;
		for (int i = 0; i < 4; i++) {
			if (check(k, i)) {
				ret = Math.max(ret, dp(k + w[i].length));
			}
		}

		return dp[k] = ret;
	}

	boolean check(int i, int k) {
		for (int j = 0; j < w[k].length; j++) {
			if (c.length <= i + j) {
				return false;
			}
			if (c[i + j] != w[k][j]) {
				return false;
			}
		}
		return true;
	}

	void run() {
		Scanner sc = new Scanner(System.in);

		c = sc.next().toCharArray();
		dp = new int[c.length];
		System.out.println(dp(0) == 1 ? "YES" : "NO");
	}

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