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

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

		String S = buff.readLine();

		S = S.replace("eraser", "1");
		S = S.replace("erase", "1");
		S = S.replace("dreamer", "1");
		S = S.replace("dream", "1");
		S = S.replace("1", "");
		System.out.println(S.equals("") ? "YES" : "NO");
	}

	static long f() {
		long ans = 0;

		return ans;
	}
} 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 buff = null;
		buff = new BufferedReader(new InputStreamReader(System.in));

		String S = buff.readLine();

		S = S.replace("eraser", "1");
		S = S.replace("erase", "1");
		S = S.replace("dreamer", "1");
		S = S.replace("dream", "1");
		S = S.replace("1", "");
		System.out.println(S.equals("") ? "YES" : "NO");
	}

	static long f() {
		long ans = 0;

		return ans;
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader buff = null;
		buff = new BufferedReader(new InputStreamReader(System.in));

		String S = buff.readLine();

		S = S.replace("eraser", "1");
		S = S.replace("erase", "1");
		S = S.replace("dreamer", "1");
		S = S.replace("dream", "1");
		S = S.replace("1", "");
		System.out.println(S.equals("") ? "YES" : "NO");
	} main {
		BufferedReader buff = null;
		buff = new BufferedReader(new InputStreamReader(System.in));

		String S = buff.readLine();

		S = S.replace("eraser", "1");
		S = S.replace("erase", "1");
		S = S.replace("dreamer", "1");
		S = S.replace("dream", "1");
		S = S.replace("1", "");
		System.out.println(S.equals("") ? "YES" : "NO");
	} BufferedReader buff = null; buff null buff = new BufferedReader(new InputStreamReader(System.in)) buff new BufferedReader(new InputStreamReader(System.in)) String S = buff.readLine(); S buff.readLine() buff.readLine buff S = S.replace("eraser", "1") S S.replace("eraser", "1") S.replace S "eraser" "1" S = S.replace("erase", "1") S S.replace("erase", "1") S.replace S "erase" "1" S = S.replace("dreamer", "1") S S.replace("dreamer", "1") S.replace S "dreamer" "1" S = S.replace("dream", "1") S S.replace("dream", "1") S.replace S "dream" "1" S = S.replace("1", "") S S.replace("1", "") S.replace S "1" "" System.out.println(S.equals("") ? "YES" : "NO") System.out.println System.out System System.out S.equals("") ? "YES" : "NO" S.equals("") S.equals S "" "YES" "NO" String[] args args static long f() {
		long ans = 0;

		return ans;
	} f {
		long ans = 0;

		return ans;
	} long ans = 0; ans 0 return ans; ans public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader buff = null;
		buff = new BufferedReader(new InputStreamReader(System.in));

		String S = buff.readLine();

		S = S.replace("eraser", "1");
		S = S.replace("erase", "1");
		S = S.replace("dreamer", "1");
		S = S.replace("dream", "1");
		S = S.replace("1", "");
		System.out.println(S.equals("") ? "YES" : "NO");
	}

	static long f() {
		long ans = 0;

		return ans;
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader buff = null;
		buff = new BufferedReader(new InputStreamReader(System.in));

		String S = buff.readLine();

		S = S.replace("eraser", "1");
		S = S.replace("erase", "1");
		S = S.replace("dreamer", "1");
		S = S.replace("dream", "1");
		S = S.replace("1", "");
		System.out.println(S.equals("") ? "YES" : "NO");
	}

	static long f() {
		long ans = 0;

		return ans;
	}
} 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 buff = null;
		buff = new BufferedReader(new InputStreamReader(System.in));

		String S = buff.readLine();

		S = S.replace("eraser", "1");
		S = S.replace("erase", "1");
		S = S.replace("dreamer", "1");
		S = S.replace("dream", "1");
		S = S.replace("1", "");
		System.out.println(S.equals("") ? "YES" : "NO");
	}

	static long f() {
		long ans = 0;

		return ans;
	}
}