import java.util.*;

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

		String S = sc.next();

		S = S.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "");

		println(S.equals("") ? "YES" : "NO");
	}

	public static String remove(String str, String str2) {
		int index = str.indexOf(str2);
		str.substring(0, index);
		str = new String(str.substring(0, index) + str.substring(index+str2.length()));
		return str;
	}
	public static void print(Object o) {
		System.out.print(o);
	}

	public static void println(Object o) {
		System.out.println(o);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String S = sc.next();

		S = S.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "");

		println(S.equals("") ? "YES" : "NO");
	}

	public static String remove(String str, String str2) {
		int index = str.indexOf(str2);
		str.substring(0, index);
		str = new String(str.substring(0, index) + str.substring(index+str2.length()));
		return str;
	}
	public static void print(Object o) {
		System.out.print(o);
	}

	public static void println(Object o) {
		System.out.println(o);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String S = sc.next();

		S = S.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "");

		println(S.equals("") ? "YES" : "NO");
	} main {
		Scanner sc = new Scanner(System.in);

		String S = sc.next();

		S = S.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "");

		println(S.equals("") ? "YES" : "NO");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc S = S.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "") S S.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "") S.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace S.replace("eraser", "").replace("erase", "").replace("dreamer", "") S.replace("eraser", "").replace("erase", "").replace S.replace("eraser", "").replace("erase", "") S.replace("eraser", "").replace S.replace("eraser", "") S.replace S "eraser" "" "erase" "" "dreamer" "" "dream" "" println(S.equals("") ? "YES" : "NO") println S.equals("") ? "YES" : "NO" S.equals("") S.equals S "" "YES" "NO" String[] args args public static String remove(String str, String str2) {
		int index = str.indexOf(str2);
		str.substring(0, index);
		str = new String(str.substring(0, index) + str.substring(index+str2.length()));
		return str;
	} remove {
		int index = str.indexOf(str2);
		str.substring(0, index);
		str = new String(str.substring(0, index) + str.substring(index+str2.length()));
		return str;
	} int index = str.indexOf(str2); index str.indexOf(str2) str.indexOf str str2 str.substring(0, index) str.substring str 0 index str = new String(str.substring(0, index) + str.substring(index+str2.length())) str new String(str.substring(0, index) + str.substring(index+str2.length())) return str; str String str str String str2 str2 public static void print(Object o) {
		System.out.print(o);
	} print {
		System.out.print(o);
	} System.out.print(o) System.out.print System.out System System.out o Object o o public static void println(Object o) {
		System.out.println(o);
	} println {
		System.out.println(o);
	} System.out.println(o) System.out.println System.out System System.out o Object o o public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String S = sc.next();

		S = S.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "");

		println(S.equals("") ? "YES" : "NO");
	}

	public static String remove(String str, String str2) {
		int index = str.indexOf(str2);
		str.substring(0, index);
		str = new String(str.substring(0, index) + str.substring(index+str2.length()));
		return str;
	}
	public static void print(Object o) {
		System.out.print(o);
	}

	public static void println(Object o) {
		System.out.println(o);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String S = sc.next();

		S = S.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "");

		println(S.equals("") ? "YES" : "NO");
	}

	public static String remove(String str, String str2) {
		int index = str.indexOf(str2);
		str.substring(0, index);
		str = new String(str.substring(0, index) + str.substring(index+str2.length()));
		return str;
	}
	public static void print(Object o) {
		System.out.print(o);
	}

	public static void println(Object o) {
		System.out.println(o);
	}
} Main
import java.util.*;

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

		String S = sc.next();

		S = S.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "");

		println(S.equals("") ? "YES" : "NO");
	}

	public static String remove(String str, String str2) {
		int index = str.indexOf(str2);
		str.substring(0, index);
		str = new String(str.substring(0, index) + str.substring(index+str2.length()));
		return str;
	}
	public static void print(Object o) {
		System.out.print(o);
	}

	public static void println(Object o) {
		System.out.println(o);
	}
}