	import java.util.*;
	
	
	
	public class Main {
	
		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			String S = sc.next();
			
			S=S.replaceAll("eraser", "-");
			S=S.replaceAll("erase", "-");
			S=S.replaceAll("dreamer", "-");
			S=S.replaceAll("dream", "-");
			S=S.replaceAll("-", "");
			if (S.length() == 0) {
				System.out.println("YES");
			}else {
				System.out.println("NO");
			}
			
			sc.close();
			
		}
		
		
	} import java.util.*; util.* java public class Main {
	
		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			String S = sc.next();
			
			S=S.replaceAll("eraser", "-");
			S=S.replaceAll("erase", "-");
			S=S.replaceAll("dreamer", "-");
			S=S.replaceAll("dream", "-");
			S=S.replaceAll("-", "");
			if (S.length() == 0) {
				System.out.println("YES");
			}else {
				System.out.println("NO");
			}
			
			sc.close();
			
		}
		
		
	} Main public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			String S = sc.next();
			
			S=S.replaceAll("eraser", "-");
			S=S.replaceAll("erase", "-");
			S=S.replaceAll("dreamer", "-");
			S=S.replaceAll("dream", "-");
			S=S.replaceAll("-", "");
			if (S.length() == 0) {
				System.out.println("YES");
			}else {
				System.out.println("NO");
			}
			
			sc.close();
			
		} main {
			Scanner sc = new Scanner(System.in);
			String S = sc.next();
			
			S=S.replaceAll("eraser", "-");
			S=S.replaceAll("erase", "-");
			S=S.replaceAll("dreamer", "-");
			S=S.replaceAll("dream", "-");
			S=S.replaceAll("-", "");
			if (S.length() == 0) {
				System.out.println("YES");
			}else {
				System.out.println("NO");
			}
			
			sc.close();
			
		} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc S=S.replaceAll("eraser", "-") S S.replaceAll("eraser", "-") S.replaceAll S "eraser" "-" S=S.replaceAll("erase", "-") S S.replaceAll("erase", "-") S.replaceAll S "erase" "-" S=S.replaceAll("dreamer", "-") S S.replaceAll("dreamer", "-") S.replaceAll S "dreamer" "-" S=S.replaceAll("dream", "-") S S.replaceAll("dream", "-") S.replaceAll S "dream" "-" S=S.replaceAll("-", "") S S.replaceAll("-", "") S.replaceAll S "-" "" if (S.length() == 0) {
				System.out.println("YES");
			}else {
				System.out.println("NO");
			} S.length() == 0 S.length() S.length 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" sc.close() sc.close sc String[] args args public class Main {
	
		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			String S = sc.next();
			
			S=S.replaceAll("eraser", "-");
			S=S.replaceAll("erase", "-");
			S=S.replaceAll("dreamer", "-");
			S=S.replaceAll("dream", "-");
			S=S.replaceAll("-", "");
			if (S.length() == 0) {
				System.out.println("YES");
			}else {
				System.out.println("NO");
			}
			
			sc.close();
			
		}
		
		
	} public class Main {
	
		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			String S = sc.next();
			
			S=S.replaceAll("eraser", "-");
			S=S.replaceAll("erase", "-");
			S=S.replaceAll("dreamer", "-");
			S=S.replaceAll("dream", "-");
			S=S.replaceAll("-", "");
			if (S.length() == 0) {
				System.out.println("YES");
			}else {
				System.out.println("NO");
			}
			
			sc.close();
			
		}
		
		
	} Main
	import java.util.*;
	
	
	
	public class Main {
	
		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			String S = sc.next();
			
			S=S.replaceAll("eraser", "-");
			S=S.replaceAll("erase", "-");
			S=S.replaceAll("dreamer", "-");
			S=S.replaceAll("dream", "-");
			S=S.replaceAll("-", "");
			if (S.length() == 0) {
				System.out.println("YES");
			}else {
				System.out.println("NO");
			}
			
			sc.close();
			
		}
		
		
	}