import java.util.*;

public class Main {
	
	private static String dreamer = "dreamer";
	private static String dream = "dream";
	private static String erase = "erase";
	private static String eraser = "eraser";
			
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] wordList = new String[] {
			eraser, erase, dreamer, dream
		};
		
		String input = sc.nextLine();
		for (String s: wordList) {
			input = input.replace(s, ".");
		}
		
		for (int i = 0; i < input.length(); i++) {
			if (input.charAt(i) != '.') {
				System.out.println("NO");
				return;
			}
		}
		
		System.out.println("YES");
		
	}
	
} import java.util.*; util.* java public class Main {
	
	private static String dreamer = "dreamer";
	private static String dream = "dream";
	private static String erase = "erase";
	private static String eraser = "eraser";
			
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] wordList = new String[] {
			eraser, erase, dreamer, dream
		};
		
		String input = sc.nextLine();
		for (String s: wordList) {
			input = input.replace(s, ".");
		}
		
		for (int i = 0; i < input.length(); i++) {
			if (input.charAt(i) != '.') {
				System.out.println("NO");
				return;
			}
		}
		
		System.out.println("YES");
		
	}
	
} Main private static String dreamer = "dreamer"; dreamer "dreamer" private static String dream = "dream"; dream "dream" private static String erase = "erase"; erase "erase" private static String eraser = "eraser"; eraser "eraser" public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] wordList = new String[] {
			eraser, erase, dreamer, dream
		};
		
		String input = sc.nextLine();
		for (String s: wordList) {
			input = input.replace(s, ".");
		}
		
		for (int i = 0; i < input.length(); i++) {
			if (input.charAt(i) != '.') {
				System.out.println("NO");
				return;
			}
		}
		
		System.out.println("YES");
		
	} main {
		Scanner sc = new Scanner(System.in);
		String[] wordList = new String[] {
			eraser, erase, dreamer, dream
		};
		
		String input = sc.nextLine();
		for (String s: wordList) {
			input = input.replace(s, ".");
		}
		
		for (int i = 0; i < input.length(); i++) {
			if (input.charAt(i) != '.') {
				System.out.println("NO");
				return;
			}
		}
		
		System.out.println("YES");
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] wordList = new String[] {
			eraser, erase, dreamer, dream
		}; wordList new String[] {
			eraser, erase, dreamer, dream
		} String input = sc.nextLine(); input sc.nextLine() sc.nextLine sc for (String s: wordList) {
			input = input.replace(s, ".");
		} String s wordList {
			input = input.replace(s, ".");
		} {
			input = input.replace(s, ".");
		} input = input.replace(s, ".") input input.replace(s, ".") input.replace input s "." for (int i = 0; i < input.length(); i++) {
			if (input.charAt(i) != '.') {
				System.out.println("NO");
				return;
			}
		} int i = 0; int i = 0; i 0 i < input.length() i input.length() input.length input i++ i++ i {
			if (input.charAt(i) != '.') {
				System.out.println("NO");
				return;
			}
		} {
			if (input.charAt(i) != '.') {
				System.out.println("NO");
				return;
			}
		} if (input.charAt(i) != '.') {
				System.out.println("NO");
				return;
			} input.charAt(i) != '.' input.charAt(i) input.charAt input i '.' {
				System.out.println("NO");
				return;
			} System.out.println("NO") System.out.println System.out System System.out "NO" return; System.out.println("YES") System.out.println System.out System System.out "YES" String[] args args public class Main {
	
	private static String dreamer = "dreamer";
	private static String dream = "dream";
	private static String erase = "erase";
	private static String eraser = "eraser";
			
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] wordList = new String[] {
			eraser, erase, dreamer, dream
		};
		
		String input = sc.nextLine();
		for (String s: wordList) {
			input = input.replace(s, ".");
		}
		
		for (int i = 0; i < input.length(); i++) {
			if (input.charAt(i) != '.') {
				System.out.println("NO");
				return;
			}
		}
		
		System.out.println("YES");
		
	}
	
} public class Main {
	
	private static String dreamer = "dreamer";
	private static String dream = "dream";
	private static String erase = "erase";
	private static String eraser = "eraser";
			
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] wordList = new String[] {
			eraser, erase, dreamer, dream
		};
		
		String input = sc.nextLine();
		for (String s: wordList) {
			input = input.replace(s, ".");
		}
		
		for (int i = 0; i < input.length(); i++) {
			if (input.charAt(i) != '.') {
				System.out.println("NO");
				return;
			}
		}
		
		System.out.println("YES");
		
	}
	
} Main
import java.util.*;

public class Main {
	
	private static String dreamer = "dreamer";
	private static String dream = "dream";
	private static String erase = "erase";
	private static String eraser = "eraser";
			
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] wordList = new String[] {
			eraser, erase, dreamer, dream
		};
		
		String input = sc.nextLine();
		for (String s: wordList) {
			input = input.replace(s, ".");
		}
		
		for (int i = 0; i < input.length(); i++) {
			if (input.charAt(i) != '.') {
				System.out.println("NO");
				return;
			}
		}
		
		System.out.println("YES");
		
	}
	
}
