import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		final Scanner sc = new Scanner(System.in);
		String s = sc.next();
		StringBuilder sb = new StringBuilder(s);
		final String d = "dream";
		final String eer = "eraser";
		final String ee = "erase";
		final String er = "er";
		boolean ok = true;
		boolean AfterDream = false;
		while(sb.length()!=0) {
			if(sb.length() >= 5&&sb.substring(0, 5).equals(d)) {
				sb.delete(0, 5);
				AfterDream = true;
				continue;
			} else 	if(sb.length() >= 6&&sb.substring(0, 6).equals(eer)) {
				sb.delete(0, 6);
			} else if(sb.length() >= 5&&sb.substring(0, 5).equals(ee)) {
				sb.delete(0, 5);
			} else if(AfterDream==true&&sb.length() >= 2 &&sb.substring(0, 2).equals(er)) {
				sb.delete(0, 2);
				AfterDream = false;
			} else {
				ok = false;
				break;
			}
			AfterDream = false;
		}
		System.out.println(ok ? "YES" : "NO");
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		final Scanner sc = new Scanner(System.in);
		String s = sc.next();
		StringBuilder sb = new StringBuilder(s);
		final String d = "dream";
		final String eer = "eraser";
		final String ee = "erase";
		final String er = "er";
		boolean ok = true;
		boolean AfterDream = false;
		while(sb.length()!=0) {
			if(sb.length() >= 5&&sb.substring(0, 5).equals(d)) {
				sb.delete(0, 5);
				AfterDream = true;
				continue;
			} else 	if(sb.length() >= 6&&sb.substring(0, 6).equals(eer)) {
				sb.delete(0, 6);
			} else if(sb.length() >= 5&&sb.substring(0, 5).equals(ee)) {
				sb.delete(0, 5);
			} else if(AfterDream==true&&sb.length() >= 2 &&sb.substring(0, 2).equals(er)) {
				sb.delete(0, 2);
				AfterDream = false;
			} else {
				ok = false;
				break;
			}
			AfterDream = false;
		}
		System.out.println(ok ? "YES" : "NO");
	}
} Main public static void main(String[] args) {
		final Scanner sc = new Scanner(System.in);
		String s = sc.next();
		StringBuilder sb = new StringBuilder(s);
		final String d = "dream";
		final String eer = "eraser";
		final String ee = "erase";
		final String er = "er";
		boolean ok = true;
		boolean AfterDream = false;
		while(sb.length()!=0) {
			if(sb.length() >= 5&&sb.substring(0, 5).equals(d)) {
				sb.delete(0, 5);
				AfterDream = true;
				continue;
			} else 	if(sb.length() >= 6&&sb.substring(0, 6).equals(eer)) {
				sb.delete(0, 6);
			} else if(sb.length() >= 5&&sb.substring(0, 5).equals(ee)) {
				sb.delete(0, 5);
			} else if(AfterDream==true&&sb.length() >= 2 &&sb.substring(0, 2).equals(er)) {
				sb.delete(0, 2);
				AfterDream = false;
			} else {
				ok = false;
				break;
			}
			AfterDream = false;
		}
		System.out.println(ok ? "YES" : "NO");
	} main {
		final Scanner sc = new Scanner(System.in);
		String s = sc.next();
		StringBuilder sb = new StringBuilder(s);
		final String d = "dream";
		final String eer = "eraser";
		final String ee = "erase";
		final String er = "er";
		boolean ok = true;
		boolean AfterDream = false;
		while(sb.length()!=0) {
			if(sb.length() >= 5&&sb.substring(0, 5).equals(d)) {
				sb.delete(0, 5);
				AfterDream = true;
				continue;
			} else 	if(sb.length() >= 6&&sb.substring(0, 6).equals(eer)) {
				sb.delete(0, 6);
			} else if(sb.length() >= 5&&sb.substring(0, 5).equals(ee)) {
				sb.delete(0, 5);
			} else if(AfterDream==true&&sb.length() >= 2 &&sb.substring(0, 2).equals(er)) {
				sb.delete(0, 2);
				AfterDream = false;
			} else {
				ok = false;
				break;
			}
			AfterDream = false;
		}
		System.out.println(ok ? "YES" : "NO");
	} final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc StringBuilder sb = new StringBuilder(s); sb new StringBuilder(s) final String d = "dream"; d "dream" final String eer = "eraser"; eer "eraser" final String ee = "erase"; ee "erase" final String er = "er"; er "er" boolean ok = true; ok true boolean AfterDream = false; AfterDream false while(sb.length()!=0) {
			if(sb.length() >= 5&&sb.substring(0, 5).equals(d)) {
				sb.delete(0, 5);
				AfterDream = true;
				continue;
			} else 	if(sb.length() >= 6&&sb.substring(0, 6).equals(eer)) {
				sb.delete(0, 6);
			} else if(sb.length() >= 5&&sb.substring(0, 5).equals(ee)) {
				sb.delete(0, 5);
			} else if(AfterDream==true&&sb.length() >= 2 &&sb.substring(0, 2).equals(er)) {
				sb.delete(0, 2);
				AfterDream = false;
			} else {
				ok = false;
				break;
			}
			AfterDream = false;
		} sb.length()!=0 sb.length() sb.length sb 0 {
			if(sb.length() >= 5&&sb.substring(0, 5).equals(d)) {
				sb.delete(0, 5);
				AfterDream = true;
				continue;
			} else 	if(sb.length() >= 6&&sb.substring(0, 6).equals(eer)) {
				sb.delete(0, 6);
			} else if(sb.length() >= 5&&sb.substring(0, 5).equals(ee)) {
				sb.delete(0, 5);
			} else if(AfterDream==true&&sb.length() >= 2 &&sb.substring(0, 2).equals(er)) {
				sb.delete(0, 2);
				AfterDream = false;
			} else {
				ok = false;
				break;
			}
			AfterDream = false;
		} if(sb.length() >= 5&&sb.substring(0, 5).equals(d)) {
				sb.delete(0, 5);
				AfterDream = true;
				continue;
			} else 	if(sb.length() >= 6&&sb.substring(0, 6).equals(eer)) {
				sb.delete(0, 6);
			} else if(sb.length() >= 5&&sb.substring(0, 5).equals(ee)) {
				sb.delete(0, 5);
			} else if(AfterDream==true&&sb.length() >= 2 &&sb.substring(0, 2).equals(er)) {
				sb.delete(0, 2);
				AfterDream = false;
			} else {
				ok = false;
				break;
			} sb.length() >= 5&&sb.substring(0, 5).equals(d) sb.length() >= 5 sb.length() sb.length sb 5 sb.substring(0, 5).equals(d) sb.substring(0, 5).equals sb.substring(0, 5) sb.substring sb 0 5 d {
				sb.delete(0, 5);
				AfterDream = true;
				continue;
			} sb.delete(0, 5) sb.delete sb 0 5 AfterDream = true AfterDream true continue; if(sb.length() >= 6&&sb.substring(0, 6).equals(eer)) {
				sb.delete(0, 6);
			} else if(sb.length() >= 5&&sb.substring(0, 5).equals(ee)) {
				sb.delete(0, 5);
			} else if(AfterDream==true&&sb.length() >= 2 &&sb.substring(0, 2).equals(er)) {
				sb.delete(0, 2);
				AfterDream = false;
			} else {
				ok = false;
				break;
			} sb.length() >= 6&&sb.substring(0, 6).equals(eer) sb.length() >= 6 sb.length() sb.length sb 6 sb.substring(0, 6).equals(eer) sb.substring(0, 6).equals sb.substring(0, 6) sb.substring sb 0 6 eer {
				sb.delete(0, 6);
			} sb.delete(0, 6) sb.delete sb 0 6 if(sb.length() >= 5&&sb.substring(0, 5).equals(ee)) {
				sb.delete(0, 5);
			} else if(AfterDream==true&&sb.length() >= 2 &&sb.substring(0, 2).equals(er)) {
				sb.delete(0, 2);
				AfterDream = false;
			} else {
				ok = false;
				break;
			} sb.length() >= 5&&sb.substring(0, 5).equals(ee) sb.length() >= 5 sb.length() sb.length sb 5 sb.substring(0, 5).equals(ee) sb.substring(0, 5).equals sb.substring(0, 5) sb.substring sb 0 5 ee {
				sb.delete(0, 5);
			} sb.delete(0, 5) sb.delete sb 0 5 if(AfterDream==true&&sb.length() >= 2 &&sb.substring(0, 2).equals(er)) {
				sb.delete(0, 2);
				AfterDream = false;
			} else {
				ok = false;
				break;
			} AfterDream==true&&sb.length() >= 2 &&sb.substring(0, 2).equals(er) AfterDream==true&&sb.length() >= 2 &&sb.substring(0, 2).equals(er) AfterDream==true AfterDream true sb.length() >= 2 sb.length() sb.length sb 2 sb.substring(0, 2).equals(er) sb.substring(0, 2).equals sb.substring(0, 2) sb.substring sb 0 2 er {
				sb.delete(0, 2);
				AfterDream = false;
			} sb.delete(0, 2) sb.delete sb 0 2 AfterDream = false AfterDream false {
				ok = false;
				break;
			} ok = false ok false break; AfterDream = false AfterDream false System.out.println(ok ? "YES" : "NO") System.out.println System.out System System.out ok ? "YES" : "NO" ok "YES" "NO" String[] args args public class Main {
	public static void main(String[] args) {
		final Scanner sc = new Scanner(System.in);
		String s = sc.next();
		StringBuilder sb = new StringBuilder(s);
		final String d = "dream";
		final String eer = "eraser";
		final String ee = "erase";
		final String er = "er";
		boolean ok = true;
		boolean AfterDream = false;
		while(sb.length()!=0) {
			if(sb.length() >= 5&&sb.substring(0, 5).equals(d)) {
				sb.delete(0, 5);
				AfterDream = true;
				continue;
			} else 	if(sb.length() >= 6&&sb.substring(0, 6).equals(eer)) {
				sb.delete(0, 6);
			} else if(sb.length() >= 5&&sb.substring(0, 5).equals(ee)) {
				sb.delete(0, 5);
			} else if(AfterDream==true&&sb.length() >= 2 &&sb.substring(0, 2).equals(er)) {
				sb.delete(0, 2);
				AfterDream = false;
			} else {
				ok = false;
				break;
			}
			AfterDream = false;
		}
		System.out.println(ok ? "YES" : "NO");
	}
} public class Main {
	public static void main(String[] args) {
		final Scanner sc = new Scanner(System.in);
		String s = sc.next();
		StringBuilder sb = new StringBuilder(s);
		final String d = "dream";
		final String eer = "eraser";
		final String ee = "erase";
		final String er = "er";
		boolean ok = true;
		boolean AfterDream = false;
		while(sb.length()!=0) {
			if(sb.length() >= 5&&sb.substring(0, 5).equals(d)) {
				sb.delete(0, 5);
				AfterDream = true;
				continue;
			} else 	if(sb.length() >= 6&&sb.substring(0, 6).equals(eer)) {
				sb.delete(0, 6);
			} else if(sb.length() >= 5&&sb.substring(0, 5).equals(ee)) {
				sb.delete(0, 5);
			} else if(AfterDream==true&&sb.length() >= 2 &&sb.substring(0, 2).equals(er)) {
				sb.delete(0, 2);
				AfterDream = false;
			} else {
				ok = false;
				break;
			}
			AfterDream = false;
		}
		System.out.println(ok ? "YES" : "NO");
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		final Scanner sc = new Scanner(System.in);
		String s = sc.next();
		StringBuilder sb = new StringBuilder(s);
		final String d = "dream";
		final String eer = "eraser";
		final String ee = "erase";
		final String er = "er";
		boolean ok = true;
		boolean AfterDream = false;
		while(sb.length()!=0) {
			if(sb.length() >= 5&&sb.substring(0, 5).equals(d)) {
				sb.delete(0, 5);
				AfterDream = true;
				continue;
			} else 	if(sb.length() >= 6&&sb.substring(0, 6).equals(eer)) {
				sb.delete(0, 6);
			} else if(sb.length() >= 5&&sb.substring(0, 5).equals(ee)) {
				sb.delete(0, 5);
			} else if(AfterDream==true&&sb.length() >= 2 &&sb.substring(0, 2).equals(er)) {
				sb.delete(0, 2);
				AfterDream = false;
			} else {
				ok = false;
				break;
			}
			AfterDream = false;
		}
		System.out.println(ok ? "YES" : "NO");
	}
}