import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		
		if (judge(s, 0)) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
	
	public static boolean judge(String s, int i) {
		if (i == s.length()) {
			return true;
		}
		
		boolean f = false;
		
		if (s.length() >= i + 7 && s.substring(i, i + 7).equals("dreamer")) {
			f |= judge(s, i + 7);
		} 
		if (s.length() >= i + 5 && s.substring(i, i + 5).equals("dream")) {
			f |= judge(s, i + 5);
		} 
		if (s.length() >= i + 6 && s.substring(i, i + 6).equals("eraser")) {
			f |= judge(s, i + 6);
		} 
		if (s.length() >= i + 5 && s.substring(i, i + 5).equals("erase")) {
			f |= judge(s, i + 5);
		} 
		
		return f;
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		
		if (judge(s, 0)) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
	
	public static boolean judge(String s, int i) {
		if (i == s.length()) {
			return true;
		}
		
		boolean f = false;
		
		if (s.length() >= i + 7 && s.substring(i, i + 7).equals("dreamer")) {
			f |= judge(s, i + 7);
		} 
		if (s.length() >= i + 5 && s.substring(i, i + 5).equals("dream")) {
			f |= judge(s, i + 5);
		} 
		if (s.length() >= i + 6 && s.substring(i, i + 6).equals("eraser")) {
			f |= judge(s, i + 6);
		} 
		if (s.length() >= i + 5 && s.substring(i, i + 5).equals("erase")) {
			f |= judge(s, i + 5);
		} 
		
		return f;
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		
		if (judge(s, 0)) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		
		if (judge(s, 0)) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc if (judge(s, 0)) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		} judge(s, 0) judge s 0 {
			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 static boolean judge(String s, int i) {
		if (i == s.length()) {
			return true;
		}
		
		boolean f = false;
		
		if (s.length() >= i + 7 && s.substring(i, i + 7).equals("dreamer")) {
			f |= judge(s, i + 7);
		} 
		if (s.length() >= i + 5 && s.substring(i, i + 5).equals("dream")) {
			f |= judge(s, i + 5);
		} 
		if (s.length() >= i + 6 && s.substring(i, i + 6).equals("eraser")) {
			f |= judge(s, i + 6);
		} 
		if (s.length() >= i + 5 && s.substring(i, i + 5).equals("erase")) {
			f |= judge(s, i + 5);
		} 
		
		return f;
	} judge {
		if (i == s.length()) {
			return true;
		}
		
		boolean f = false;
		
		if (s.length() >= i + 7 && s.substring(i, i + 7).equals("dreamer")) {
			f |= judge(s, i + 7);
		} 
		if (s.length() >= i + 5 && s.substring(i, i + 5).equals("dream")) {
			f |= judge(s, i + 5);
		} 
		if (s.length() >= i + 6 && s.substring(i, i + 6).equals("eraser")) {
			f |= judge(s, i + 6);
		} 
		if (s.length() >= i + 5 && s.substring(i, i + 5).equals("erase")) {
			f |= judge(s, i + 5);
		} 
		
		return f;
	} if (i == s.length()) {
			return true;
		} i == s.length() i s.length() s.length s {
			return true;
		} return true; true boolean f = false; f false if (s.length() >= i + 7 && s.substring(i, i + 7).equals("dreamer")) {
			f |= judge(s, i + 7);
		} s.length() >= i + 7 && s.substring(i, i + 7).equals("dreamer") s.length() >= i + 7 s.length() s.length s i + 7 i 7 s.substring(i, i + 7).equals("dreamer") s.substring(i, i + 7).equals s.substring(i, i + 7) s.substring s i i + 7 i 7 "dreamer" {
			f |= judge(s, i + 7);
		} f |= judge(s, i + 7) f judge(s, i + 7) judge s i + 7 i 7 if (s.length() >= i + 5 && s.substring(i, i + 5).equals("dream")) {
			f |= judge(s, i + 5);
		} s.length() >= i + 5 && s.substring(i, i + 5).equals("dream") s.length() >= i + 5 s.length() s.length s i + 5 i 5 s.substring(i, i + 5).equals("dream") s.substring(i, i + 5).equals s.substring(i, i + 5) s.substring s i i + 5 i 5 "dream" {
			f |= judge(s, i + 5);
		} f |= judge(s, i + 5) f judge(s, i + 5) judge s i + 5 i 5 if (s.length() >= i + 6 && s.substring(i, i + 6).equals("eraser")) {
			f |= judge(s, i + 6);
		} s.length() >= i + 6 && s.substring(i, i + 6).equals("eraser") s.length() >= i + 6 s.length() s.length s i + 6 i 6 s.substring(i, i + 6).equals("eraser") s.substring(i, i + 6).equals s.substring(i, i + 6) s.substring s i i + 6 i 6 "eraser" {
			f |= judge(s, i + 6);
		} f |= judge(s, i + 6) f judge(s, i + 6) judge s i + 6 i 6 if (s.length() >= i + 5 && s.substring(i, i + 5).equals("erase")) {
			f |= judge(s, i + 5);
		} s.length() >= i + 5 && s.substring(i, i + 5).equals("erase") s.length() >= i + 5 s.length() s.length s i + 5 i 5 s.substring(i, i + 5).equals("erase") s.substring(i, i + 5).equals s.substring(i, i + 5) s.substring s i i + 5 i 5 "erase" {
			f |= judge(s, i + 5);
		} f |= judge(s, i + 5) f judge(s, i + 5) judge s i + 5 i 5 return f; f String s s int i i public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		
		if (judge(s, 0)) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
	
	public static boolean judge(String s, int i) {
		if (i == s.length()) {
			return true;
		}
		
		boolean f = false;
		
		if (s.length() >= i + 7 && s.substring(i, i + 7).equals("dreamer")) {
			f |= judge(s, i + 7);
		} 
		if (s.length() >= i + 5 && s.substring(i, i + 5).equals("dream")) {
			f |= judge(s, i + 5);
		} 
		if (s.length() >= i + 6 && s.substring(i, i + 6).equals("eraser")) {
			f |= judge(s, i + 6);
		} 
		if (s.length() >= i + 5 && s.substring(i, i + 5).equals("erase")) {
			f |= judge(s, i + 5);
		} 
		
		return f;
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		
		if (judge(s, 0)) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
	
	public static boolean judge(String s, int i) {
		if (i == s.length()) {
			return true;
		}
		
		boolean f = false;
		
		if (s.length() >= i + 7 && s.substring(i, i + 7).equals("dreamer")) {
			f |= judge(s, i + 7);
		} 
		if (s.length() >= i + 5 && s.substring(i, i + 5).equals("dream")) {
			f |= judge(s, i + 5);
		} 
		if (s.length() >= i + 6 && s.substring(i, i + 6).equals("eraser")) {
			f |= judge(s, i + 6);
		} 
		if (s.length() >= i + 5 && s.substring(i, i + 5).equals("erase")) {
			f |= judge(s, i + 5);
		} 
		
		return f;
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		
		if (judge(s, 0)) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
	
	public static boolean judge(String s, int i) {
		if (i == s.length()) {
			return true;
		}
		
		boolean f = false;
		
		if (s.length() >= i + 7 && s.substring(i, i + 7).equals("dreamer")) {
			f |= judge(s, i + 7);
		} 
		if (s.length() >= i + 5 && s.substring(i, i + 5).equals("dream")) {
			f |= judge(s, i + 5);
		} 
		if (s.length() >= i + 6 && s.substring(i, i + 6).equals("eraser")) {
			f |= judge(s, i + 6);
		} 
		if (s.length() >= i + 5 && s.substring(i, i + 5).equals("erase")) {
			f |= judge(s, i + 5);
		} 
		
		return f;
	}
}