import java.util.Scanner;

public class Main {

	public static String dream = "dream";
	public static String dreamer = "dreamer";
	public static String erase = "erase";
	public static String eraser = "eraser";

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

		int pointer = s.length();
		while(true) {
			if (isMatchedString(pointer, s, dream)) {
				pointer -= dream.length();
			} else if (isMatchedString(pointer, s, dreamer)) {
				pointer -= dreamer.length();
			} else if (isMatchedString(pointer, s, erase)) {
				pointer -= erase.length();
			} else if (isMatchedString(pointer, s, eraser)) {
				pointer -= eraser.length();
			} else {
				System.out.println("NO");
				break;
			}
			if (isFinished(pointer, s)) {
				System.out.println("YES");
				break;
			}
		}
	}


	public static boolean isMatchedString(int endIndex, String s, String d) {
		return 0 <= endIndex - d.length() && s.substring(endIndex - d.length(), endIndex).equals(d);
	}

	public static boolean isFinished(int index, String s) {
		return index == 0;
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static String dream = "dream";
	public static String dreamer = "dreamer";
	public static String erase = "erase";
	public static String eraser = "eraser";

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

		int pointer = s.length();
		while(true) {
			if (isMatchedString(pointer, s, dream)) {
				pointer -= dream.length();
			} else if (isMatchedString(pointer, s, dreamer)) {
				pointer -= dreamer.length();
			} else if (isMatchedString(pointer, s, erase)) {
				pointer -= erase.length();
			} else if (isMatchedString(pointer, s, eraser)) {
				pointer -= eraser.length();
			} else {
				System.out.println("NO");
				break;
			}
			if (isFinished(pointer, s)) {
				System.out.println("YES");
				break;
			}
		}
	}


	public static boolean isMatchedString(int endIndex, String s, String d) {
		return 0 <= endIndex - d.length() && s.substring(endIndex - d.length(), endIndex).equals(d);
	}

	public static boolean isFinished(int index, String s) {
		return index == 0;
	}

} Main public static String dream = "dream"; dream "dream" public static String dreamer = "dreamer"; dreamer "dreamer" public static String erase = "erase"; erase "erase" public static String eraser = "eraser"; eraser "eraser" public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();

		int pointer = s.length();
		while(true) {
			if (isMatchedString(pointer, s, dream)) {
				pointer -= dream.length();
			} else if (isMatchedString(pointer, s, dreamer)) {
				pointer -= dreamer.length();
			} else if (isMatchedString(pointer, s, erase)) {
				pointer -= erase.length();
			} else if (isMatchedString(pointer, s, eraser)) {
				pointer -= eraser.length();
			} else {
				System.out.println("NO");
				break;
			}
			if (isFinished(pointer, s)) {
				System.out.println("YES");
				break;
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();

		int pointer = s.length();
		while(true) {
			if (isMatchedString(pointer, s, dream)) {
				pointer -= dream.length();
			} else if (isMatchedString(pointer, s, dreamer)) {
				pointer -= dreamer.length();
			} else if (isMatchedString(pointer, s, erase)) {
				pointer -= erase.length();
			} else if (isMatchedString(pointer, s, eraser)) {
				pointer -= eraser.length();
			} else {
				System.out.println("NO");
				break;
			}
			if (isFinished(pointer, s)) {
				System.out.println("YES");
				break;
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int pointer = s.length(); pointer s.length() s.length s while(true) {
			if (isMatchedString(pointer, s, dream)) {
				pointer -= dream.length();
			} else if (isMatchedString(pointer, s, dreamer)) {
				pointer -= dreamer.length();
			} else if (isMatchedString(pointer, s, erase)) {
				pointer -= erase.length();
			} else if (isMatchedString(pointer, s, eraser)) {
				pointer -= eraser.length();
			} else {
				System.out.println("NO");
				break;
			}
			if (isFinished(pointer, s)) {
				System.out.println("YES");
				break;
			}
		} true {
			if (isMatchedString(pointer, s, dream)) {
				pointer -= dream.length();
			} else if (isMatchedString(pointer, s, dreamer)) {
				pointer -= dreamer.length();
			} else if (isMatchedString(pointer, s, erase)) {
				pointer -= erase.length();
			} else if (isMatchedString(pointer, s, eraser)) {
				pointer -= eraser.length();
			} else {
				System.out.println("NO");
				break;
			}
			if (isFinished(pointer, s)) {
				System.out.println("YES");
				break;
			}
		} if (isMatchedString(pointer, s, dream)) {
				pointer -= dream.length();
			} else if (isMatchedString(pointer, s, dreamer)) {
				pointer -= dreamer.length();
			} else if (isMatchedString(pointer, s, erase)) {
				pointer -= erase.length();
			} else if (isMatchedString(pointer, s, eraser)) {
				pointer -= eraser.length();
			} else {
				System.out.println("NO");
				break;
			} isMatchedString(pointer, s, dream) isMatchedString pointer s dream {
				pointer -= dream.length();
			} pointer -= dream.length() pointer dream.length() dream.length dream if (isMatchedString(pointer, s, dreamer)) {
				pointer -= dreamer.length();
			} else if (isMatchedString(pointer, s, erase)) {
				pointer -= erase.length();
			} else if (isMatchedString(pointer, s, eraser)) {
				pointer -= eraser.length();
			} else {
				System.out.println("NO");
				break;
			} isMatchedString(pointer, s, dreamer) isMatchedString pointer s dreamer {
				pointer -= dreamer.length();
			} pointer -= dreamer.length() pointer dreamer.length() dreamer.length dreamer if (isMatchedString(pointer, s, erase)) {
				pointer -= erase.length();
			} else if (isMatchedString(pointer, s, eraser)) {
				pointer -= eraser.length();
			} else {
				System.out.println("NO");
				break;
			} isMatchedString(pointer, s, erase) isMatchedString pointer s erase {
				pointer -= erase.length();
			} pointer -= erase.length() pointer erase.length() erase.length erase if (isMatchedString(pointer, s, eraser)) {
				pointer -= eraser.length();
			} else {
				System.out.println("NO");
				break;
			} isMatchedString(pointer, s, eraser) isMatchedString pointer s eraser {
				pointer -= eraser.length();
			} pointer -= eraser.length() pointer eraser.length() eraser.length eraser {
				System.out.println("NO");
				break;
			} System.out.println("NO") System.out.println System.out System System.out "NO" break; if (isFinished(pointer, s)) {
				System.out.println("YES");
				break;
			} isFinished(pointer, s) isFinished pointer s {
				System.out.println("YES");
				break;
			} System.out.println("YES") System.out.println System.out System System.out "YES" break; String[] args args public static boolean isMatchedString(int endIndex, String s, String d) {
		return 0 <= endIndex - d.length() && s.substring(endIndex - d.length(), endIndex).equals(d);
	} isMatchedString {
		return 0 <= endIndex - d.length() && s.substring(endIndex - d.length(), endIndex).equals(d);
	} return 0 <= endIndex - d.length() && s.substring(endIndex - d.length(), endIndex).equals(d); 0 <= endIndex - d.length() && s.substring(endIndex - d.length(), endIndex).equals(d) 0 <= endIndex - d.length() 0 endIndex - d.length() endIndex d.length() d.length d s.substring(endIndex - d.length(), endIndex).equals(d) s.substring(endIndex - d.length(), endIndex).equals s.substring(endIndex - d.length(), endIndex) s.substring s endIndex - d.length() endIndex d.length() d.length d endIndex d int endIndex endIndex String s s String d d public static boolean isFinished(int index, String s) {
		return index == 0;
	} isFinished {
		return index == 0;
	} return index == 0; index == 0 index 0 int index index String s s public class Main {

	public static String dream = "dream";
	public static String dreamer = "dreamer";
	public static String erase = "erase";
	public static String eraser = "eraser";

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

		int pointer = s.length();
		while(true) {
			if (isMatchedString(pointer, s, dream)) {
				pointer -= dream.length();
			} else if (isMatchedString(pointer, s, dreamer)) {
				pointer -= dreamer.length();
			} else if (isMatchedString(pointer, s, erase)) {
				pointer -= erase.length();
			} else if (isMatchedString(pointer, s, eraser)) {
				pointer -= eraser.length();
			} else {
				System.out.println("NO");
				break;
			}
			if (isFinished(pointer, s)) {
				System.out.println("YES");
				break;
			}
		}
	}


	public static boolean isMatchedString(int endIndex, String s, String d) {
		return 0 <= endIndex - d.length() && s.substring(endIndex - d.length(), endIndex).equals(d);
	}

	public static boolean isFinished(int index, String s) {
		return index == 0;
	}

} public class Main {

	public static String dream = "dream";
	public static String dreamer = "dreamer";
	public static String erase = "erase";
	public static String eraser = "eraser";

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

		int pointer = s.length();
		while(true) {
			if (isMatchedString(pointer, s, dream)) {
				pointer -= dream.length();
			} else if (isMatchedString(pointer, s, dreamer)) {
				pointer -= dreamer.length();
			} else if (isMatchedString(pointer, s, erase)) {
				pointer -= erase.length();
			} else if (isMatchedString(pointer, s, eraser)) {
				pointer -= eraser.length();
			} else {
				System.out.println("NO");
				break;
			}
			if (isFinished(pointer, s)) {
				System.out.println("YES");
				break;
			}
		}
	}


	public static boolean isMatchedString(int endIndex, String s, String d) {
		return 0 <= endIndex - d.length() && s.substring(endIndex - d.length(), endIndex).equals(d);
	}

	public static boolean isFinished(int index, String s) {
		return index == 0;
	}

} Main
import java.util.Scanner;

public class Main {

	public static String dream = "dream";
	public static String dreamer = "dreamer";
	public static String erase = "erase";
	public static String eraser = "eraser";

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

		int pointer = s.length();
		while(true) {
			if (isMatchedString(pointer, s, dream)) {
				pointer -= dream.length();
			} else if (isMatchedString(pointer, s, dreamer)) {
				pointer -= dreamer.length();
			} else if (isMatchedString(pointer, s, erase)) {
				pointer -= erase.length();
			} else if (isMatchedString(pointer, s, eraser)) {
				pointer -= eraser.length();
			} else {
				System.out.println("NO");
				break;
			}
			if (isFinished(pointer, s)) {
				System.out.println("YES");
				break;
			}
		}
	}


	public static boolean isMatchedString(int endIndex, String s, String d) {
		return 0 <= endIndex - d.length() && s.substring(endIndex - d.length(), endIndex).equals(d);
	}

	public static boolean isFinished(int index, String s) {
		return index == 0;
	}

}
