import java.util.*;

public class Main {
	
	static final String[] TYPE = new String[]{"dream", "dreamer", "erase", "eraser"};
	
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder(sc.next());
		while (sb.length() > 0) {
			boolean flag = false;
			for (int i = 0; i < TYPE.length; i++) {
				int idx = sb.indexOf(TYPE[i], sb.length() - TYPE[i].length());
				if (idx != -1) {
					sb.delete(idx, sb.length());
					flag = true;
					break;
				}
			}
			if (flag) {
				continue;
			} else {
				System.out.println("NO");
				return;
			}
		}
		System.out.print("YES");
	}
} import java.util.*; util.* java public class Main {
	
	static final String[] TYPE = new String[]{"dream", "dreamer", "erase", "eraser"};
	
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder(sc.next());
		while (sb.length() > 0) {
			boolean flag = false;
			for (int i = 0; i < TYPE.length; i++) {
				int idx = sb.indexOf(TYPE[i], sb.length() - TYPE[i].length());
				if (idx != -1) {
					sb.delete(idx, sb.length());
					flag = true;
					break;
				}
			}
			if (flag) {
				continue;
			} else {
				System.out.println("NO");
				return;
			}
		}
		System.out.print("YES");
	}
} Main static final String[] TYPE = new String[]{"dream", "dreamer", "erase", "eraser"}; TYPE new String[]{"dream", "dreamer", "erase", "eraser"} public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder(sc.next());
		while (sb.length() > 0) {
			boolean flag = false;
			for (int i = 0; i < TYPE.length; i++) {
				int idx = sb.indexOf(TYPE[i], sb.length() - TYPE[i].length());
				if (idx != -1) {
					sb.delete(idx, sb.length());
					flag = true;
					break;
				}
			}
			if (flag) {
				continue;
			} else {
				System.out.println("NO");
				return;
			}
		}
		System.out.print("YES");
	} main {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder(sc.next());
		while (sb.length() > 0) {
			boolean flag = false;
			for (int i = 0; i < TYPE.length; i++) {
				int idx = sb.indexOf(TYPE[i], sb.length() - TYPE[i].length());
				if (idx != -1) {
					sb.delete(idx, sb.length());
					flag = true;
					break;
				}
			}
			if (flag) {
				continue;
			} else {
				System.out.println("NO");
				return;
			}
		}
		System.out.print("YES");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder sb = new StringBuilder(sc.next()); sb new StringBuilder(sc.next()) while (sb.length() > 0) {
			boolean flag = false;
			for (int i = 0; i < TYPE.length; i++) {
				int idx = sb.indexOf(TYPE[i], sb.length() - TYPE[i].length());
				if (idx != -1) {
					sb.delete(idx, sb.length());
					flag = true;
					break;
				}
			}
			if (flag) {
				continue;
			} else {
				System.out.println("NO");
				return;
			}
		} sb.length() > 0 sb.length() sb.length sb 0 {
			boolean flag = false;
			for (int i = 0; i < TYPE.length; i++) {
				int idx = sb.indexOf(TYPE[i], sb.length() - TYPE[i].length());
				if (idx != -1) {
					sb.delete(idx, sb.length());
					flag = true;
					break;
				}
			}
			if (flag) {
				continue;
			} else {
				System.out.println("NO");
				return;
			}
		} boolean flag = false; flag false for (int i = 0; i < TYPE.length; i++) {
				int idx = sb.indexOf(TYPE[i], sb.length() - TYPE[i].length());
				if (idx != -1) {
					sb.delete(idx, sb.length());
					flag = true;
					break;
				}
			} int i = 0; int i = 0; i 0 i < TYPE.length i TYPE.length TYPE TYPE.length i++ i++ i {
				int idx = sb.indexOf(TYPE[i], sb.length() - TYPE[i].length());
				if (idx != -1) {
					sb.delete(idx, sb.length());
					flag = true;
					break;
				}
			} {
				int idx = sb.indexOf(TYPE[i], sb.length() - TYPE[i].length());
				if (idx != -1) {
					sb.delete(idx, sb.length());
					flag = true;
					break;
				}
			} int idx = sb.indexOf(TYPE[i], sb.length() - TYPE[i].length()); idx sb.indexOf(TYPE[i], sb.length() - TYPE[i].length()) sb.indexOf sb TYPE[i] TYPE i sb.length() - TYPE[i].length() sb.length() sb.length sb TYPE[i].length() TYPE[i].length TYPE[i] TYPE i if (idx != -1) {
					sb.delete(idx, sb.length());
					flag = true;
					break;
				} idx != -1 idx -1 1 {
					sb.delete(idx, sb.length());
					flag = true;
					break;
				} sb.delete(idx, sb.length()) sb.delete sb idx sb.length() sb.length sb flag = true flag true break; if (flag) {
				continue;
			} else {
				System.out.println("NO");
				return;
			} flag {
				continue;
			} continue; {
				System.out.println("NO");
				return;
			} System.out.println("NO") System.out.println System.out System System.out "NO" return; System.out.print("YES") System.out.print System.out System System.out "YES" String[] args args public class Main {
	
	static final String[] TYPE = new String[]{"dream", "dreamer", "erase", "eraser"};
	
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder(sc.next());
		while (sb.length() > 0) {
			boolean flag = false;
			for (int i = 0; i < TYPE.length; i++) {
				int idx = sb.indexOf(TYPE[i], sb.length() - TYPE[i].length());
				if (idx != -1) {
					sb.delete(idx, sb.length());
					flag = true;
					break;
				}
			}
			if (flag) {
				continue;
			} else {
				System.out.println("NO");
				return;
			}
		}
		System.out.print("YES");
	}
} public class Main {
	
	static final String[] TYPE = new String[]{"dream", "dreamer", "erase", "eraser"};
	
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder(sc.next());
		while (sb.length() > 0) {
			boolean flag = false;
			for (int i = 0; i < TYPE.length; i++) {
				int idx = sb.indexOf(TYPE[i], sb.length() - TYPE[i].length());
				if (idx != -1) {
					sb.delete(idx, sb.length());
					flag = true;
					break;
				}
			}
			if (flag) {
				continue;
			} else {
				System.out.println("NO");
				return;
			}
		}
		System.out.print("YES");
	}
} Main
import java.util.*;

public class Main {
	
	static final String[] TYPE = new String[]{"dream", "dreamer", "erase", "eraser"};
	
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder(sc.next());
		while (sb.length() > 0) {
			boolean flag = false;
			for (int i = 0; i < TYPE.length; i++) {
				int idx = sb.indexOf(TYPE[i], sb.length() - TYPE[i].length());
				if (idx != -1) {
					sb.delete(idx, sb.length());
					flag = true;
					break;
				}
			}
			if (flag) {
				continue;
			} else {
				System.out.println("NO");
				return;
			}
		}
		System.out.print("YES");
	}
}
