import java.util.*;

// ABC 49-C
// http://abc050.contest.atcoder.jp/tasks/arc066_a

public class Main {
	
	static int MOD = 1000000007;

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		char[] c = in.next().toCharArray();
		int clen = c.length - 1;
		boolean isValid = true;
		
		while (clen >= 0 && isValid) {
			// Check dream
			if (clen - 4 >= 0 &&
					c[clen - 4] == 'd' && c[clen - 3] == 'r' && c[clen - 2] == 'e' && c[clen - 1] == 'a' && c[clen] == 'm') {
				clen -= 5;
				continue;
			}
			// Check dreamer
			if (clen - 6 >= 0 &&
					c[clen - 6] == 'd' && c[clen - 5] == 'r' && c[clen - 4] == 'e' && c[clen - 3] == 'a' && c[clen - 2] == 'm' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 7;
				continue;
			}
			// Check erase
			if (clen - 4 >= 0 &&
					c[clen - 4] == 'e' && c[clen - 3] == 'r' && c[clen - 2] == 'a' && c[clen - 1] == 's' && c[clen] == 'e') {
				clen -= 5;
				continue;
			}
			// Check eraser
			if (clen - 5 >= 0 &&
					c[clen - 5] == 'e' && c[clen - 4] == 'r' && c[clen - 3] == 'a' && c[clen - 2] == 's' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 6;
				continue;
			}
			isValid = false;
		}
		System.out.println(isValid ? "YES" : "NO");
		
	}
} import java.util.*; util.* java public class Main {
	
	static int MOD = 1000000007;

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		char[] c = in.next().toCharArray();
		int clen = c.length - 1;
		boolean isValid = true;
		
		while (clen >= 0 && isValid) {
			// Check dream
			if (clen - 4 >= 0 &&
					c[clen - 4] == 'd' && c[clen - 3] == 'r' && c[clen - 2] == 'e' && c[clen - 1] == 'a' && c[clen] == 'm') {
				clen -= 5;
				continue;
			}
			// Check dreamer
			if (clen - 6 >= 0 &&
					c[clen - 6] == 'd' && c[clen - 5] == 'r' && c[clen - 4] == 'e' && c[clen - 3] == 'a' && c[clen - 2] == 'm' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 7;
				continue;
			}
			// Check erase
			if (clen - 4 >= 0 &&
					c[clen - 4] == 'e' && c[clen - 3] == 'r' && c[clen - 2] == 'a' && c[clen - 1] == 's' && c[clen] == 'e') {
				clen -= 5;
				continue;
			}
			// Check eraser
			if (clen - 5 >= 0 &&
					c[clen - 5] == 'e' && c[clen - 4] == 'r' && c[clen - 3] == 'a' && c[clen - 2] == 's' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 6;
				continue;
			}
			isValid = false;
		}
		System.out.println(isValid ? "YES" : "NO");
		
	}
} Main static int MOD = 1000000007; MOD 1000000007 public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		char[] c = in.next().toCharArray();
		int clen = c.length - 1;
		boolean isValid = true;
		
		while (clen >= 0 && isValid) {
			// Check dream
			if (clen - 4 >= 0 &&
					c[clen - 4] == 'd' && c[clen - 3] == 'r' && c[clen - 2] == 'e' && c[clen - 1] == 'a' && c[clen] == 'm') {
				clen -= 5;
				continue;
			}
			// Check dreamer
			if (clen - 6 >= 0 &&
					c[clen - 6] == 'd' && c[clen - 5] == 'r' && c[clen - 4] == 'e' && c[clen - 3] == 'a' && c[clen - 2] == 'm' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 7;
				continue;
			}
			// Check erase
			if (clen - 4 >= 0 &&
					c[clen - 4] == 'e' && c[clen - 3] == 'r' && c[clen - 2] == 'a' && c[clen - 1] == 's' && c[clen] == 'e') {
				clen -= 5;
				continue;
			}
			// Check eraser
			if (clen - 5 >= 0 &&
					c[clen - 5] == 'e' && c[clen - 4] == 'r' && c[clen - 3] == 'a' && c[clen - 2] == 's' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 6;
				continue;
			}
			isValid = false;
		}
		System.out.println(isValid ? "YES" : "NO");
		
	} main {
		Scanner in = new Scanner(System.in);
		
		char[] c = in.next().toCharArray();
		int clen = c.length - 1;
		boolean isValid = true;
		
		while (clen >= 0 && isValid) {
			// Check dream
			if (clen - 4 >= 0 &&
					c[clen - 4] == 'd' && c[clen - 3] == 'r' && c[clen - 2] == 'e' && c[clen - 1] == 'a' && c[clen] == 'm') {
				clen -= 5;
				continue;
			}
			// Check dreamer
			if (clen - 6 >= 0 &&
					c[clen - 6] == 'd' && c[clen - 5] == 'r' && c[clen - 4] == 'e' && c[clen - 3] == 'a' && c[clen - 2] == 'm' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 7;
				continue;
			}
			// Check erase
			if (clen - 4 >= 0 &&
					c[clen - 4] == 'e' && c[clen - 3] == 'r' && c[clen - 2] == 'a' && c[clen - 1] == 's' && c[clen] == 'e') {
				clen -= 5;
				continue;
			}
			// Check eraser
			if (clen - 5 >= 0 &&
					c[clen - 5] == 'e' && c[clen - 4] == 'r' && c[clen - 3] == 'a' && c[clen - 2] == 's' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 6;
				continue;
			}
			isValid = false;
		}
		System.out.println(isValid ? "YES" : "NO");
		
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) char[] c = in.next().toCharArray(); c in.next().toCharArray() in.next().toCharArray in.next() in.next in int clen = c.length - 1; clen c.length - 1 c.length c c.length 1 boolean isValid = true; isValid true while (clen >= 0 && isValid) {
			// Check dream
			if (clen - 4 >= 0 &&
					c[clen - 4] == 'd' && c[clen - 3] == 'r' && c[clen - 2] == 'e' && c[clen - 1] == 'a' && c[clen] == 'm') {
				clen -= 5;
				continue;
			}
			// Check dreamer
			if (clen - 6 >= 0 &&
					c[clen - 6] == 'd' && c[clen - 5] == 'r' && c[clen - 4] == 'e' && c[clen - 3] == 'a' && c[clen - 2] == 'm' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 7;
				continue;
			}
			// Check erase
			if (clen - 4 >= 0 &&
					c[clen - 4] == 'e' && c[clen - 3] == 'r' && c[clen - 2] == 'a' && c[clen - 1] == 's' && c[clen] == 'e') {
				clen -= 5;
				continue;
			}
			// Check eraser
			if (clen - 5 >= 0 &&
					c[clen - 5] == 'e' && c[clen - 4] == 'r' && c[clen - 3] == 'a' && c[clen - 2] == 's' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 6;
				continue;
			}
			isValid = false;
		} clen >= 0 && isValid clen >= 0 clen 0 isValid {
			// Check dream
			if (clen - 4 >= 0 &&
					c[clen - 4] == 'd' && c[clen - 3] == 'r' && c[clen - 2] == 'e' && c[clen - 1] == 'a' && c[clen] == 'm') {
				clen -= 5;
				continue;
			}
			// Check dreamer
			if (clen - 6 >= 0 &&
					c[clen - 6] == 'd' && c[clen - 5] == 'r' && c[clen - 4] == 'e' && c[clen - 3] == 'a' && c[clen - 2] == 'm' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 7;
				continue;
			}
			// Check erase
			if (clen - 4 >= 0 &&
					c[clen - 4] == 'e' && c[clen - 3] == 'r' && c[clen - 2] == 'a' && c[clen - 1] == 's' && c[clen] == 'e') {
				clen -= 5;
				continue;
			}
			// Check eraser
			if (clen - 5 >= 0 &&
					c[clen - 5] == 'e' && c[clen - 4] == 'r' && c[clen - 3] == 'a' && c[clen - 2] == 's' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 6;
				continue;
			}
			isValid = false;
		} if (clen - 4 >= 0 &&
					c[clen - 4] == 'd' && c[clen - 3] == 'r' && c[clen - 2] == 'e' && c[clen - 1] == 'a' && c[clen] == 'm') {
				clen -= 5;
				continue;
			} clen - 4 >= 0 &&
					c[clen - 4] == 'd' && c[clen - 3] == 'r' && c[clen - 2] == 'e' && c[clen - 1] == 'a' && c[clen] == 'm' c[clen - 1] == 'a' c[clen - 2] == 'e' c[clen - 3] == 'r' clen - 4 >= 0 &&
					c[clen - 4] == 'd' && c[clen - 3] == 'r' && c[clen - 2] == 'e' && c[clen - 1] == 'a' && c[clen] == 'm' clen - 4 >= 0 clen - 4 clen 4 0 c[clen - 4] == 'd' c[clen - 4] c clen - 4 clen 4 'd' c[clen - 3] == 'r' c[clen - 3] c clen - 3 clen 3 'r' c[clen - 2] == 'e' c[clen - 2] c clen - 2 clen 2 'e' c[clen - 1] == 'a' c[clen - 1] c clen - 1 clen 1 'a' c[clen] == 'm' c[clen] c clen 'm' {
				clen -= 5;
				continue;
			} clen -= 5 clen 5 continue; if (clen - 6 >= 0 &&
					c[clen - 6] == 'd' && c[clen - 5] == 'r' && c[clen - 4] == 'e' && c[clen - 3] == 'a' && c[clen - 2] == 'm' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 7;
				continue;
			} clen - 6 >= 0 &&
					c[clen - 6] == 'd' && c[clen - 5] == 'r' && c[clen - 4] == 'e' && c[clen - 3] == 'a' && c[clen - 2] == 'm' && c[clen - 1] == 'e' && c[clen] == 'r' c[clen - 1] == 'e' c[clen - 2] == 'm' c[clen - 3] == 'a' c[clen - 4] == 'e' c[clen - 5] == 'r' clen - 6 >= 0 &&
					c[clen - 6] == 'd' && c[clen - 5] == 'r' && c[clen - 4] == 'e' && c[clen - 3] == 'a' && c[clen - 2] == 'm' && c[clen - 1] == 'e' && c[clen] == 'r' clen - 6 >= 0 clen - 6 clen 6 0 c[clen - 6] == 'd' c[clen - 6] c clen - 6 clen 6 'd' c[clen - 5] == 'r' c[clen - 5] c clen - 5 clen 5 'r' c[clen - 4] == 'e' c[clen - 4] c clen - 4 clen 4 'e' c[clen - 3] == 'a' c[clen - 3] c clen - 3 clen 3 'a' c[clen - 2] == 'm' c[clen - 2] c clen - 2 clen 2 'm' c[clen - 1] == 'e' c[clen - 1] c clen - 1 clen 1 'e' c[clen] == 'r' c[clen] c clen 'r' {
				clen -= 7;
				continue;
			} clen -= 7 clen 7 continue; if (clen - 4 >= 0 &&
					c[clen - 4] == 'e' && c[clen - 3] == 'r' && c[clen - 2] == 'a' && c[clen - 1] == 's' && c[clen] == 'e') {
				clen -= 5;
				continue;
			} clen - 4 >= 0 &&
					c[clen - 4] == 'e' && c[clen - 3] == 'r' && c[clen - 2] == 'a' && c[clen - 1] == 's' && c[clen] == 'e' c[clen - 1] == 's' c[clen - 2] == 'a' c[clen - 3] == 'r' clen - 4 >= 0 &&
					c[clen - 4] == 'e' && c[clen - 3] == 'r' && c[clen - 2] == 'a' && c[clen - 1] == 's' && c[clen] == 'e' clen - 4 >= 0 clen - 4 clen 4 0 c[clen - 4] == 'e' c[clen - 4] c clen - 4 clen 4 'e' c[clen - 3] == 'r' c[clen - 3] c clen - 3 clen 3 'r' c[clen - 2] == 'a' c[clen - 2] c clen - 2 clen 2 'a' c[clen - 1] == 's' c[clen - 1] c clen - 1 clen 1 's' c[clen] == 'e' c[clen] c clen 'e' {
				clen -= 5;
				continue;
			} clen -= 5 clen 5 continue; if (clen - 5 >= 0 &&
					c[clen - 5] == 'e' && c[clen - 4] == 'r' && c[clen - 3] == 'a' && c[clen - 2] == 's' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 6;
				continue;
			} clen - 5 >= 0 &&
					c[clen - 5] == 'e' && c[clen - 4] == 'r' && c[clen - 3] == 'a' && c[clen - 2] == 's' && c[clen - 1] == 'e' && c[clen] == 'r' c[clen - 1] == 'e' c[clen - 2] == 's' c[clen - 3] == 'a' c[clen - 4] == 'r' clen - 5 >= 0 &&
					c[clen - 5] == 'e' && c[clen - 4] == 'r' && c[clen - 3] == 'a' && c[clen - 2] == 's' && c[clen - 1] == 'e' && c[clen] == 'r' clen - 5 >= 0 clen - 5 clen 5 0 c[clen - 5] == 'e' c[clen - 5] c clen - 5 clen 5 'e' c[clen - 4] == 'r' c[clen - 4] c clen - 4 clen 4 'r' c[clen - 3] == 'a' c[clen - 3] c clen - 3 clen 3 'a' c[clen - 2] == 's' c[clen - 2] c clen - 2 clen 2 's' c[clen - 1] == 'e' c[clen - 1] c clen - 1 clen 1 'e' c[clen] == 'r' c[clen] c clen 'r' {
				clen -= 6;
				continue;
			} clen -= 6 clen 6 continue; isValid = false isValid false System.out.println(isValid ? "YES" : "NO") System.out.println System.out System System.out isValid ? "YES" : "NO" isValid "YES" "NO" String[] args args public class Main {
	
	static int MOD = 1000000007;

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		char[] c = in.next().toCharArray();
		int clen = c.length - 1;
		boolean isValid = true;
		
		while (clen >= 0 && isValid) {
			// Check dream
			if (clen - 4 >= 0 &&
					c[clen - 4] == 'd' && c[clen - 3] == 'r' && c[clen - 2] == 'e' && c[clen - 1] == 'a' && c[clen] == 'm') {
				clen -= 5;
				continue;
			}
			// Check dreamer
			if (clen - 6 >= 0 &&
					c[clen - 6] == 'd' && c[clen - 5] == 'r' && c[clen - 4] == 'e' && c[clen - 3] == 'a' && c[clen - 2] == 'm' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 7;
				continue;
			}
			// Check erase
			if (clen - 4 >= 0 &&
					c[clen - 4] == 'e' && c[clen - 3] == 'r' && c[clen - 2] == 'a' && c[clen - 1] == 's' && c[clen] == 'e') {
				clen -= 5;
				continue;
			}
			// Check eraser
			if (clen - 5 >= 0 &&
					c[clen - 5] == 'e' && c[clen - 4] == 'r' && c[clen - 3] == 'a' && c[clen - 2] == 's' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 6;
				continue;
			}
			isValid = false;
		}
		System.out.println(isValid ? "YES" : "NO");
		
	}
} public class Main {
	
	static int MOD = 1000000007;

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		char[] c = in.next().toCharArray();
		int clen = c.length - 1;
		boolean isValid = true;
		
		while (clen >= 0 && isValid) {
			// Check dream
			if (clen - 4 >= 0 &&
					c[clen - 4] == 'd' && c[clen - 3] == 'r' && c[clen - 2] == 'e' && c[clen - 1] == 'a' && c[clen] == 'm') {
				clen -= 5;
				continue;
			}
			// Check dreamer
			if (clen - 6 >= 0 &&
					c[clen - 6] == 'd' && c[clen - 5] == 'r' && c[clen - 4] == 'e' && c[clen - 3] == 'a' && c[clen - 2] == 'm' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 7;
				continue;
			}
			// Check erase
			if (clen - 4 >= 0 &&
					c[clen - 4] == 'e' && c[clen - 3] == 'r' && c[clen - 2] == 'a' && c[clen - 1] == 's' && c[clen] == 'e') {
				clen -= 5;
				continue;
			}
			// Check eraser
			if (clen - 5 >= 0 &&
					c[clen - 5] == 'e' && c[clen - 4] == 'r' && c[clen - 3] == 'a' && c[clen - 2] == 's' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 6;
				continue;
			}
			isValid = false;
		}
		System.out.println(isValid ? "YES" : "NO");
		
	}
} Main
import java.util.*;

// ABC 49-C
// http://abc050.contest.atcoder.jp/tasks/arc066_a

public class Main {
	
	static int MOD = 1000000007;

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		char[] c = in.next().toCharArray();
		int clen = c.length - 1;
		boolean isValid = true;
		
		while (clen >= 0 && isValid) {
			// Check dream
			if (clen - 4 >= 0 &&
					c[clen - 4] == 'd' && c[clen - 3] == 'r' && c[clen - 2] == 'e' && c[clen - 1] == 'a' && c[clen] == 'm') {
				clen -= 5;
				continue;
			}
			// Check dreamer
			if (clen - 6 >= 0 &&
					c[clen - 6] == 'd' && c[clen - 5] == 'r' && c[clen - 4] == 'e' && c[clen - 3] == 'a' && c[clen - 2] == 'm' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 7;
				continue;
			}
			// Check erase
			if (clen - 4 >= 0 &&
					c[clen - 4] == 'e' && c[clen - 3] == 'r' && c[clen - 2] == 'a' && c[clen - 1] == 's' && c[clen] == 'e') {
				clen -= 5;
				continue;
			}
			// Check eraser
			if (clen - 5 >= 0 &&
					c[clen - 5] == 'e' && c[clen - 4] == 'r' && c[clen - 3] == 'a' && c[clen - 2] == 's' && c[clen - 1] == 'e' && c[clen] == 'r') {
				clen -= 6;
				continue;
			}
			isValid = false;
		}
		System.out.println(isValid ? "YES" : "NO");
		
	}
}