import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String word = sc.next();
		for(int i = word.length(); i >=0;) {
			if(i - 5 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-5,i).equals("dream") || word.substring(i-5,i).equals("erase")) {
				i -= 5;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 6 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-6,i).equals("eraser")) {
				i -= 6;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 7 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-7,i).equals("dreamer")) {
				i -= 7;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}else {
				System.out.println("NO");
				return;
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String word = sc.next();
		for(int i = word.length(); i >=0;) {
			if(i - 5 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-5,i).equals("dream") || word.substring(i-5,i).equals("erase")) {
				i -= 5;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 6 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-6,i).equals("eraser")) {
				i -= 6;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 7 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-7,i).equals("dreamer")) {
				i -= 7;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}else {
				System.out.println("NO");
				return;
			}
		}
	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String word = sc.next();
		for(int i = word.length(); i >=0;) {
			if(i - 5 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-5,i).equals("dream") || word.substring(i-5,i).equals("erase")) {
				i -= 5;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 6 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-6,i).equals("eraser")) {
				i -= 6;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 7 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-7,i).equals("dreamer")) {
				i -= 7;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}else {
				System.out.println("NO");
				return;
			}
		}
	} main {

		Scanner sc = new Scanner(System.in);
		String word = sc.next();
		for(int i = word.length(); i >=0;) {
			if(i - 5 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-5,i).equals("dream") || word.substring(i-5,i).equals("erase")) {
				i -= 5;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 6 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-6,i).equals("eraser")) {
				i -= 6;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 7 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-7,i).equals("dreamer")) {
				i -= 7;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}else {
				System.out.println("NO");
				return;
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String word = sc.next(); word sc.next() sc.next sc for(int i = word.length(); i >=0;) {
			if(i - 5 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-5,i).equals("dream") || word.substring(i-5,i).equals("erase")) {
				i -= 5;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 6 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-6,i).equals("eraser")) {
				i -= 6;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 7 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-7,i).equals("dreamer")) {
				i -= 7;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}else {
				System.out.println("NO");
				return;
			}
		} int i = word.length(); int i = word.length(); i word.length() word.length word i >=0 i 0 {
			if(i - 5 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-5,i).equals("dream") || word.substring(i-5,i).equals("erase")) {
				i -= 5;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 6 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-6,i).equals("eraser")) {
				i -= 6;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 7 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-7,i).equals("dreamer")) {
				i -= 7;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}else {
				System.out.println("NO");
				return;
			}
		} {
			if(i - 5 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-5,i).equals("dream") || word.substring(i-5,i).equals("erase")) {
				i -= 5;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 6 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-6,i).equals("eraser")) {
				i -= 6;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 7 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-7,i).equals("dreamer")) {
				i -= 7;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}else {
				System.out.println("NO");
				return;
			}
		} if(i - 5 < 0) {
				System.out.println("NO");
				return;
			} i - 5 < 0 i - 5 i 5 0 {
				System.out.println("NO");
				return;
			} System.out.println("NO") System.out.println System.out System System.out "NO" return; if(word.substring(i-5,i).equals("dream") || word.substring(i-5,i).equals("erase")) {
				i -= 5;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			} word.substring(i-5,i).equals("dream") || word.substring(i-5,i).equals("erase") word.substring(i-5,i).equals("dream") word.substring(i-5,i).equals word.substring(i-5,i) word.substring word i-5 i 5 i "dream" word.substring(i-5,i).equals("erase") word.substring(i-5,i).equals word.substring(i-5,i) word.substring word i-5 i 5 i "erase" {
				i -= 5;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			} i -= 5 i 5 if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				} i == 0 i 0 {
					System.out.println("YES");
					return;
				} System.out.println("YES") System.out.println System.out System System.out "YES" return; {
					continue;
				} continue; if(i - 6 < 0) {
				System.out.println("NO");
				return;
			} i - 6 < 0 i - 6 i 6 0 {
				System.out.println("NO");
				return;
			} System.out.println("NO") System.out.println System.out System System.out "NO" return; if(word.substring(i-6,i).equals("eraser")) {
				i -= 6;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			} word.substring(i-6,i).equals("eraser") word.substring(i-6,i).equals word.substring(i-6,i) word.substring word i-6 i 6 i "eraser" {
				i -= 6;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			} i -= 6 i 6 if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				} i == 0 i 0 {
					System.out.println("YES");
					return;
				} System.out.println("YES") System.out.println System.out System System.out "YES" return; {
					continue;
				} continue; if(i - 7 < 0) {
				System.out.println("NO");
				return;
			} i - 7 < 0 i - 7 i 7 0 {
				System.out.println("NO");
				return;
			} System.out.println("NO") System.out.println System.out System System.out "NO" return; if(word.substring(i-7,i).equals("dreamer")) {
				i -= 7;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}else {
				System.out.println("NO");
				return;
			} word.substring(i-7,i).equals("dreamer") word.substring(i-7,i).equals word.substring(i-7,i) word.substring word i-7 i 7 i "dreamer" {
				i -= 7;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			} i -= 7 i 7 if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				} i == 0 i 0 {
					System.out.println("YES");
					return;
				} System.out.println("YES") System.out.println System.out System System.out "YES" return; {
					continue;
				} continue; {
				System.out.println("NO");
				return;
			} System.out.println("NO") System.out.println System.out System System.out "NO" return; String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String word = sc.next();
		for(int i = word.length(); i >=0;) {
			if(i - 5 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-5,i).equals("dream") || word.substring(i-5,i).equals("erase")) {
				i -= 5;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 6 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-6,i).equals("eraser")) {
				i -= 6;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 7 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-7,i).equals("dreamer")) {
				i -= 7;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}else {
				System.out.println("NO");
				return;
			}
		}
	}
} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String word = sc.next();
		for(int i = word.length(); i >=0;) {
			if(i - 5 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-5,i).equals("dream") || word.substring(i-5,i).equals("erase")) {
				i -= 5;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 6 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-6,i).equals("eraser")) {
				i -= 6;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 7 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-7,i).equals("dreamer")) {
				i -= 7;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}else {
				System.out.println("NO");
				return;
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String word = sc.next();
		for(int i = word.length(); i >=0;) {
			if(i - 5 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-5,i).equals("dream") || word.substring(i-5,i).equals("erase")) {
				i -= 5;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 6 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-6,i).equals("eraser")) {
				i -= 6;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}
			if(i - 7 < 0) {
				System.out.println("NO");
				return;
			}
			if(word.substring(i-7,i).equals("dreamer")) {
				i -= 7;
				if(i == 0) {
					System.out.println("YES");
					return;
				}else {
					continue;
				}
			}else {
				System.out.println("NO");
				return;
			}
		}
	}
}