import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String scStr = scanner.nextLine();
		int count = scStr.length() / 5;

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

		boolean result = false;
		boolean isEnd = false;

		for (int i = 0; i <= count; i++) {
			if (isEnd == true)
				break;
			if (scStr.endsWith(dreamer)) {
				scStr = scStr.substring(0,scStr.length()-7);
			} else if (scStr.endsWith(dream)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.endsWith(eraser)) {
				scStr = scStr.substring(0,scStr.length()-6);
			} else if (scStr.endsWith(erase)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.length() <= 7) {
				if (scStr.length() == 0) {
					result = true;
				} else if (scStr.length() == 7 && (scStr.endsWith(dreamer))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 6 && (scStr.endsWith(eraser))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				}
			}
		}
		if (result == true) {
			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) {
		Scanner scanner = new Scanner(System.in);
		String scStr = scanner.nextLine();
		int count = scStr.length() / 5;

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

		boolean result = false;
		boolean isEnd = false;

		for (int i = 0; i <= count; i++) {
			if (isEnd == true)
				break;
			if (scStr.endsWith(dreamer)) {
				scStr = scStr.substring(0,scStr.length()-7);
			} else if (scStr.endsWith(dream)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.endsWith(eraser)) {
				scStr = scStr.substring(0,scStr.length()-6);
			} else if (scStr.endsWith(erase)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.length() <= 7) {
				if (scStr.length() == 0) {
					result = true;
				} else if (scStr.length() == 7 && (scStr.endsWith(dreamer))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 6 && (scStr.endsWith(eraser))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				}
			}
		}
		if (result == true) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}

} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String scStr = scanner.nextLine();
		int count = scStr.length() / 5;

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

		boolean result = false;
		boolean isEnd = false;

		for (int i = 0; i <= count; i++) {
			if (isEnd == true)
				break;
			if (scStr.endsWith(dreamer)) {
				scStr = scStr.substring(0,scStr.length()-7);
			} else if (scStr.endsWith(dream)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.endsWith(eraser)) {
				scStr = scStr.substring(0,scStr.length()-6);
			} else if (scStr.endsWith(erase)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.length() <= 7) {
				if (scStr.length() == 0) {
					result = true;
				} else if (scStr.length() == 7 && (scStr.endsWith(dreamer))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 6 && (scStr.endsWith(eraser))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				}
			}
		}
		if (result == true) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	} main {
		Scanner scanner = new Scanner(System.in);
		String scStr = scanner.nextLine();
		int count = scStr.length() / 5;

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

		boolean result = false;
		boolean isEnd = false;

		for (int i = 0; i <= count; i++) {
			if (isEnd == true)
				break;
			if (scStr.endsWith(dreamer)) {
				scStr = scStr.substring(0,scStr.length()-7);
			} else if (scStr.endsWith(dream)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.endsWith(eraser)) {
				scStr = scStr.substring(0,scStr.length()-6);
			} else if (scStr.endsWith(erase)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.length() <= 7) {
				if (scStr.length() == 0) {
					result = true;
				} else if (scStr.length() == 7 && (scStr.endsWith(dreamer))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 6 && (scStr.endsWith(eraser))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				}
			}
		}
		if (result == true) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String scStr = scanner.nextLine(); scStr scanner.nextLine() scanner.nextLine scanner int count = scStr.length() / 5; count scStr.length() / 5 scStr.length() scStr.length scStr 5 String dream = "dream"; dream "dream" String dreamer = "dreamer"; dreamer "dreamer" String erase = "erase"; erase "erase" String eraser = "eraser"; eraser "eraser" boolean result = false; result false boolean isEnd = false; isEnd false for (int i = 0; i <= count; i++) {
			if (isEnd == true)
				break;
			if (scStr.endsWith(dreamer)) {
				scStr = scStr.substring(0,scStr.length()-7);
			} else if (scStr.endsWith(dream)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.endsWith(eraser)) {
				scStr = scStr.substring(0,scStr.length()-6);
			} else if (scStr.endsWith(erase)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.length() <= 7) {
				if (scStr.length() == 0) {
					result = true;
				} else if (scStr.length() == 7 && (scStr.endsWith(dreamer))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 6 && (scStr.endsWith(eraser))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				}
			}
		} int i = 0; int i = 0; i 0 i <= count i count i++ i++ i {
			if (isEnd == true)
				break;
			if (scStr.endsWith(dreamer)) {
				scStr = scStr.substring(0,scStr.length()-7);
			} else if (scStr.endsWith(dream)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.endsWith(eraser)) {
				scStr = scStr.substring(0,scStr.length()-6);
			} else if (scStr.endsWith(erase)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.length() <= 7) {
				if (scStr.length() == 0) {
					result = true;
				} else if (scStr.length() == 7 && (scStr.endsWith(dreamer))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 6 && (scStr.endsWith(eraser))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				}
			}
		} {
			if (isEnd == true)
				break;
			if (scStr.endsWith(dreamer)) {
				scStr = scStr.substring(0,scStr.length()-7);
			} else if (scStr.endsWith(dream)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.endsWith(eraser)) {
				scStr = scStr.substring(0,scStr.length()-6);
			} else if (scStr.endsWith(erase)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.length() <= 7) {
				if (scStr.length() == 0) {
					result = true;
				} else if (scStr.length() == 7 && (scStr.endsWith(dreamer))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 6 && (scStr.endsWith(eraser))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				}
			}
		} if (isEnd == true)
				break; isEnd == true isEnd true break; if (scStr.endsWith(dreamer)) {
				scStr = scStr.substring(0,scStr.length()-7);
			} else if (scStr.endsWith(dream)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.endsWith(eraser)) {
				scStr = scStr.substring(0,scStr.length()-6);
			} else if (scStr.endsWith(erase)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.length() <= 7) {
				if (scStr.length() == 0) {
					result = true;
				} else if (scStr.length() == 7 && (scStr.endsWith(dreamer))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 6 && (scStr.endsWith(eraser))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				}
			} scStr.endsWith(dreamer) scStr.endsWith scStr dreamer {
				scStr = scStr.substring(0,scStr.length()-7);
			} scStr = scStr.substring(0,scStr.length()-7) scStr scStr.substring(0,scStr.length()-7) scStr.substring scStr 0 scStr.length()-7 scStr.length() scStr.length scStr 7 if (scStr.endsWith(dream)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.endsWith(eraser)) {
				scStr = scStr.substring(0,scStr.length()-6);
			} else if (scStr.endsWith(erase)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.length() <= 7) {
				if (scStr.length() == 0) {
					result = true;
				} else if (scStr.length() == 7 && (scStr.endsWith(dreamer))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 6 && (scStr.endsWith(eraser))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				}
			} scStr.endsWith(dream) scStr.endsWith scStr dream {
				scStr = scStr.substring(0,scStr.length()-5);
			} scStr = scStr.substring(0,scStr.length()-5) scStr scStr.substring(0,scStr.length()-5) scStr.substring scStr 0 scStr.length()-5 scStr.length() scStr.length scStr 5 if (scStr.endsWith(eraser)) {
				scStr = scStr.substring(0,scStr.length()-6);
			} else if (scStr.endsWith(erase)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.length() <= 7) {
				if (scStr.length() == 0) {
					result = true;
				} else if (scStr.length() == 7 && (scStr.endsWith(dreamer))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 6 && (scStr.endsWith(eraser))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				}
			} scStr.endsWith(eraser) scStr.endsWith scStr eraser {
				scStr = scStr.substring(0,scStr.length()-6);
			} scStr = scStr.substring(0,scStr.length()-6) scStr scStr.substring(0,scStr.length()-6) scStr.substring scStr 0 scStr.length()-6 scStr.length() scStr.length scStr 6 if (scStr.endsWith(erase)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.length() <= 7) {
				if (scStr.length() == 0) {
					result = true;
				} else if (scStr.length() == 7 && (scStr.endsWith(dreamer))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 6 && (scStr.endsWith(eraser))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				}
			} scStr.endsWith(erase) scStr.endsWith scStr erase {
				scStr = scStr.substring(0,scStr.length()-5);
			} scStr = scStr.substring(0,scStr.length()-5) scStr scStr.substring(0,scStr.length()-5) scStr.substring scStr 0 scStr.length()-5 scStr.length() scStr.length scStr 5 if (scStr.length() <= 7) {
				if (scStr.length() == 0) {
					result = true;
				} else if (scStr.length() == 7 && (scStr.endsWith(dreamer))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 6 && (scStr.endsWith(eraser))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				}
			} scStr.length() <= 7 scStr.length() scStr.length scStr 7 {
				if (scStr.length() == 0) {
					result = true;
				} else if (scStr.length() == 7 && (scStr.endsWith(dreamer))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 6 && (scStr.endsWith(eraser))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				}
			} if (scStr.length() == 0) {
					result = true;
				} else if (scStr.length() == 7 && (scStr.endsWith(dreamer))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 6 && (scStr.endsWith(eraser))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				} scStr.length() == 0 scStr.length() scStr.length scStr 0 {
					result = true;
				} result = true result true if (scStr.length() == 7 && (scStr.endsWith(dreamer))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 6 && (scStr.endsWith(eraser))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				} scStr.length() == 7 && (scStr.endsWith(dreamer)) scStr.length() == 7 scStr.length() scStr.length scStr 7 (scStr.endsWith(dreamer)) scStr.endsWith scStr dreamer {
					result = true;
					isEnd = true;
				} result = true result true isEnd = true isEnd true if (scStr.length() == 6 && (scStr.endsWith(eraser))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				} scStr.length() == 6 && (scStr.endsWith(eraser)) scStr.length() == 6 scStr.length() scStr.length scStr 6 (scStr.endsWith(eraser)) scStr.endsWith scStr eraser {
					result = true;
					isEnd = true;
				} result = true result true isEnd = true isEnd true if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				} scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase)) scStr.length() == 5 scStr.length() scStr.length scStr 5 (scStr.endsWith(dream) || scStr.endsWith(erase)) scStr.endsWith(dream) scStr.endsWith scStr dream scStr.endsWith(erase) scStr.endsWith scStr erase {
					result = true;
					isEnd = true;
				} result = true result true isEnd = true isEnd true {
					isEnd = true;
				} isEnd = true isEnd true if (result == true) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		} result == true result true {
			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" String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String scStr = scanner.nextLine();
		int count = scStr.length() / 5;

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

		boolean result = false;
		boolean isEnd = false;

		for (int i = 0; i <= count; i++) {
			if (isEnd == true)
				break;
			if (scStr.endsWith(dreamer)) {
				scStr = scStr.substring(0,scStr.length()-7);
			} else if (scStr.endsWith(dream)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.endsWith(eraser)) {
				scStr = scStr.substring(0,scStr.length()-6);
			} else if (scStr.endsWith(erase)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.length() <= 7) {
				if (scStr.length() == 0) {
					result = true;
				} else if (scStr.length() == 7 && (scStr.endsWith(dreamer))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 6 && (scStr.endsWith(eraser))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				}
			}
		}
		if (result == true) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String scStr = scanner.nextLine();
		int count = scStr.length() / 5;

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

		boolean result = false;
		boolean isEnd = false;

		for (int i = 0; i <= count; i++) {
			if (isEnd == true)
				break;
			if (scStr.endsWith(dreamer)) {
				scStr = scStr.substring(0,scStr.length()-7);
			} else if (scStr.endsWith(dream)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.endsWith(eraser)) {
				scStr = scStr.substring(0,scStr.length()-6);
			} else if (scStr.endsWith(erase)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.length() <= 7) {
				if (scStr.length() == 0) {
					result = true;
				} else if (scStr.length() == 7 && (scStr.endsWith(dreamer))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 6 && (scStr.endsWith(eraser))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				}
			}
		}
		if (result == true) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String scStr = scanner.nextLine();
		int count = scStr.length() / 5;

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

		boolean result = false;
		boolean isEnd = false;

		for (int i = 0; i <= count; i++) {
			if (isEnd == true)
				break;
			if (scStr.endsWith(dreamer)) {
				scStr = scStr.substring(0,scStr.length()-7);
			} else if (scStr.endsWith(dream)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.endsWith(eraser)) {
				scStr = scStr.substring(0,scStr.length()-6);
			} else if (scStr.endsWith(erase)) {
				scStr = scStr.substring(0,scStr.length()-5);
			} else if (scStr.length() <= 7) {
				if (scStr.length() == 0) {
					result = true;
				} else if (scStr.length() == 7 && (scStr.endsWith(dreamer))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 6 && (scStr.endsWith(eraser))) {
					result = true;
					isEnd = true;
				} else if (scStr.length() == 5 && (scStr.endsWith(dream) || scStr.endsWith(erase))) {
					result = true;
					isEnd = true;
				}else {
					isEnd = true;
				}
			}
		}
		if (result == true) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}

}
