import java.util.Scanner;

// https://atcoder.jp/contests/abc049/tasks/arc065_a
public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		String scanStr = scanner.nextLine();
		scanner.close();
		scanner = null;

		String[] divineArray = { "dream", "dreamer", "erase", "eraser" };

		// 入力した値を反転
		scanStr = ReverseString(scanStr);
		for (int i = 0; i < divineArray.length; i++) {
			divineArray[i] = ReverseString(divineArray[i]);
		}

		boolean flag = true;
		String str = scanStr;

		for (int i = 0; i < scanStr.length()&&flag;) {
			for (String divineStr : divineArray) {
				int length = divineStr.length();
				if(scanStr.length()-i>=length) {
					str = scanStr.substring(i, length+i);
				}

				if (str.equals(divineStr)) {
					i = i + length;
					flag = true;
					break;
				}else {
					flag = false;
				}
			}
		}

		// 結果
		returnResult(flag);
	}

	// str を反転するメソッド。
	public static String ReverseString(String str) {
		StringBuffer sb = new StringBuffer(str);
		str = sb.reverse().toString();
		sb = null;
		return str;
	}

	// 結果を返すメソッド
	public static void returnResult(boolean flag) {
		if (flag) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}

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

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		String scanStr = scanner.nextLine();
		scanner.close();
		scanner = null;

		String[] divineArray = { "dream", "dreamer", "erase", "eraser" };

		// 入力した値を反転
		scanStr = ReverseString(scanStr);
		for (int i = 0; i < divineArray.length; i++) {
			divineArray[i] = ReverseString(divineArray[i]);
		}

		boolean flag = true;
		String str = scanStr;

		for (int i = 0; i < scanStr.length()&&flag;) {
			for (String divineStr : divineArray) {
				int length = divineStr.length();
				if(scanStr.length()-i>=length) {
					str = scanStr.substring(i, length+i);
				}

				if (str.equals(divineStr)) {
					i = i + length;
					flag = true;
					break;
				}else {
					flag = false;
				}
			}
		}

		// 結果
		returnResult(flag);
	}

	// str を反転するメソッド。
	public static String ReverseString(String str) {
		StringBuffer sb = new StringBuffer(str);
		str = sb.reverse().toString();
		sb = null;
		return str;
	}

	// 結果を返すメソッド
	public static void returnResult(boolean flag) {
		if (flag) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		String scanStr = scanner.nextLine();
		scanner.close();
		scanner = null;

		String[] divineArray = { "dream", "dreamer", "erase", "eraser" };

		// 入力した値を反転
		scanStr = ReverseString(scanStr);
		for (int i = 0; i < divineArray.length; i++) {
			divineArray[i] = ReverseString(divineArray[i]);
		}

		boolean flag = true;
		String str = scanStr;

		for (int i = 0; i < scanStr.length()&&flag;) {
			for (String divineStr : divineArray) {
				int length = divineStr.length();
				if(scanStr.length()-i>=length) {
					str = scanStr.substring(i, length+i);
				}

				if (str.equals(divineStr)) {
					i = i + length;
					flag = true;
					break;
				}else {
					flag = false;
				}
			}
		}

		// 結果
		returnResult(flag);
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		String scanStr = scanner.nextLine();
		scanner.close();
		scanner = null;

		String[] divineArray = { "dream", "dreamer", "erase", "eraser" };

		// 入力した値を反転
		scanStr = ReverseString(scanStr);
		for (int i = 0; i < divineArray.length; i++) {
			divineArray[i] = ReverseString(divineArray[i]);
		}

		boolean flag = true;
		String str = scanStr;

		for (int i = 0; i < scanStr.length()&&flag;) {
			for (String divineStr : divineArray) {
				int length = divineStr.length();
				if(scanStr.length()-i>=length) {
					str = scanStr.substring(i, length+i);
				}

				if (str.equals(divineStr)) {
					i = i + length;
					flag = true;
					break;
				}else {
					flag = false;
				}
			}
		}

		// 結果
		returnResult(flag);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String scanStr = scanner.nextLine(); scanStr scanner.nextLine() scanner.nextLine scanner scanner.close() scanner.close scanner scanner = null scanner null String[] divineArray = { "dream", "dreamer", "erase", "eraser" }; divineArray { "dream", "dreamer", "erase", "eraser" } "dream" "dreamer" "erase" "eraser" scanStr = ReverseString(scanStr) scanStr ReverseString(scanStr) ReverseString scanStr for (int i = 0; i < divineArray.length; i++) {
			divineArray[i] = ReverseString(divineArray[i]);
		} int i = 0; int i = 0; i 0 i < divineArray.length i divineArray.length divineArray divineArray.length i++ i++ i {
			divineArray[i] = ReverseString(divineArray[i]);
		} {
			divineArray[i] = ReverseString(divineArray[i]);
		} divineArray[i] = ReverseString(divineArray[i]) divineArray[i] divineArray i ReverseString(divineArray[i]) ReverseString divineArray[i] divineArray i boolean flag = true; flag true String str = scanStr; str scanStr for (int i = 0; i < scanStr.length()&&flag;) {
			for (String divineStr : divineArray) {
				int length = divineStr.length();
				if(scanStr.length()-i>=length) {
					str = scanStr.substring(i, length+i);
				}

				if (str.equals(divineStr)) {
					i = i + length;
					flag = true;
					break;
				}else {
					flag = false;
				}
			}
		} int i = 0; int i = 0; i 0 i < scanStr.length()&&flag i < scanStr.length() i scanStr.length() scanStr.length scanStr flag {
			for (String divineStr : divineArray) {
				int length = divineStr.length();
				if(scanStr.length()-i>=length) {
					str = scanStr.substring(i, length+i);
				}

				if (str.equals(divineStr)) {
					i = i + length;
					flag = true;
					break;
				}else {
					flag = false;
				}
			}
		} {
			for (String divineStr : divineArray) {
				int length = divineStr.length();
				if(scanStr.length()-i>=length) {
					str = scanStr.substring(i, length+i);
				}

				if (str.equals(divineStr)) {
					i = i + length;
					flag = true;
					break;
				}else {
					flag = false;
				}
			}
		} for (String divineStr : divineArray) {
				int length = divineStr.length();
				if(scanStr.length()-i>=length) {
					str = scanStr.substring(i, length+i);
				}

				if (str.equals(divineStr)) {
					i = i + length;
					flag = true;
					break;
				}else {
					flag = false;
				}
			} String divineStr divineArray {
				int length = divineStr.length();
				if(scanStr.length()-i>=length) {
					str = scanStr.substring(i, length+i);
				}

				if (str.equals(divineStr)) {
					i = i + length;
					flag = true;
					break;
				}else {
					flag = false;
				}
			} {
				int length = divineStr.length();
				if(scanStr.length()-i>=length) {
					str = scanStr.substring(i, length+i);
				}

				if (str.equals(divineStr)) {
					i = i + length;
					flag = true;
					break;
				}else {
					flag = false;
				}
			} int length = divineStr.length(); length divineStr.length() divineStr.length divineStr if(scanStr.length()-i>=length) {
					str = scanStr.substring(i, length+i);
				} scanStr.length()-i>=length scanStr.length()-i scanStr.length() scanStr.length scanStr i length {
					str = scanStr.substring(i, length+i);
				} str = scanStr.substring(i, length+i) str scanStr.substring(i, length+i) scanStr.substring scanStr i length+i length i if (str.equals(divineStr)) {
					i = i + length;
					flag = true;
					break;
				}else {
					flag = false;
				} str.equals(divineStr) str.equals str divineStr {
					i = i + length;
					flag = true;
					break;
				} i = i + length i i + length i length flag = true flag true break; {
					flag = false;
				} flag = false flag false returnResult(flag) returnResult flag String[] args args // str を反転するメソッド。
	public static String ReverseString(String str) {
		StringBuffer sb = new StringBuffer(str);
		str = sb.reverse().toString();
		sb = null;
		return str;
	} ReverseString {
		StringBuffer sb = new StringBuffer(str);
		str = sb.reverse().toString();
		sb = null;
		return str;
	} StringBuffer sb = new StringBuffer(str); sb new StringBuffer(str) str = sb.reverse().toString() str sb.reverse().toString() sb.reverse().toString sb.reverse() sb.reverse sb sb = null sb null return str; str String str str // 結果を返すメソッド
	public static void returnResult(boolean flag) {
		if (flag) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	} returnResult {
		if (flag) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	} if (flag) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		} flag {
			System.out.println("YES");
		} System.out.println("YES") System.out.println System.out System System.out "YES" {
			System.out.println("NO");
		} System.out.println("NO") System.out.println System.out System System.out "NO" boolean flag flag public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		String scanStr = scanner.nextLine();
		scanner.close();
		scanner = null;

		String[] divineArray = { "dream", "dreamer", "erase", "eraser" };

		// 入力した値を反転
		scanStr = ReverseString(scanStr);
		for (int i = 0; i < divineArray.length; i++) {
			divineArray[i] = ReverseString(divineArray[i]);
		}

		boolean flag = true;
		String str = scanStr;

		for (int i = 0; i < scanStr.length()&&flag;) {
			for (String divineStr : divineArray) {
				int length = divineStr.length();
				if(scanStr.length()-i>=length) {
					str = scanStr.substring(i, length+i);
				}

				if (str.equals(divineStr)) {
					i = i + length;
					flag = true;
					break;
				}else {
					flag = false;
				}
			}
		}

		// 結果
		returnResult(flag);
	}

	// str を反転するメソッド。
	public static String ReverseString(String str) {
		StringBuffer sb = new StringBuffer(str);
		str = sb.reverse().toString();
		sb = null;
		return str;
	}

	// 結果を返すメソッド
	public static void returnResult(boolean flag) {
		if (flag) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		String scanStr = scanner.nextLine();
		scanner.close();
		scanner = null;

		String[] divineArray = { "dream", "dreamer", "erase", "eraser" };

		// 入力した値を反転
		scanStr = ReverseString(scanStr);
		for (int i = 0; i < divineArray.length; i++) {
			divineArray[i] = ReverseString(divineArray[i]);
		}

		boolean flag = true;
		String str = scanStr;

		for (int i = 0; i < scanStr.length()&&flag;) {
			for (String divineStr : divineArray) {
				int length = divineStr.length();
				if(scanStr.length()-i>=length) {
					str = scanStr.substring(i, length+i);
				}

				if (str.equals(divineStr)) {
					i = i + length;
					flag = true;
					break;
				}else {
					flag = false;
				}
			}
		}

		// 結果
		returnResult(flag);
	}

	// str を反転するメソッド。
	public static String ReverseString(String str) {
		StringBuffer sb = new StringBuffer(str);
		str = sb.reverse().toString();
		sb = null;
		return str;
	}

	// 結果を返すメソッド
	public static void returnResult(boolean flag) {
		if (flag) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}

} Main
import java.util.Scanner;

// https://atcoder.jp/contests/abc049/tasks/arc065_a
public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		String scanStr = scanner.nextLine();
		scanner.close();
		scanner = null;

		String[] divineArray = { "dream", "dreamer", "erase", "eraser" };

		// 入力した値を反転
		scanStr = ReverseString(scanStr);
		for (int i = 0; i < divineArray.length; i++) {
			divineArray[i] = ReverseString(divineArray[i]);
		}

		boolean flag = true;
		String str = scanStr;

		for (int i = 0; i < scanStr.length()&&flag;) {
			for (String divineStr : divineArray) {
				int length = divineStr.length();
				if(scanStr.length()-i>=length) {
					str = scanStr.substring(i, length+i);
				}

				if (str.equals(divineStr)) {
					i = i + length;
					flag = true;
					break;
				}else {
					flag = false;
				}
			}
		}

		// 結果
		returnResult(flag);
	}

	// str を反転するメソッド。
	public static String ReverseString(String str) {
		StringBuffer sb = new StringBuffer(str);
		str = sb.reverse().toString();
		sb = null;
		return str;
	}

	// 結果を返すメソッド
	public static void returnResult(boolean flag) {
		if (flag) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}

}
