import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();

		char[] a = "dream".toCharArray();
		char[] b = "dreamer".toCharArray();
		char[] c = "erase".toCharArray();
		char[] d = "eraser".toCharArray();
		StringBuilder sb = new StringBuilder(s);

		while (sb.length() > 0) {
			if (isMatch(sb, a)) {
				sb.delete(sb.length() - a.length, sb.length());

			} else if (isMatch(sb, b)) {
				sb.delete(sb.length() - b.length, sb.length());

			} else if (isMatch(sb, c)) {
				sb.delete(sb.length() - c.length, sb.length());

			} else if (isMatch(sb, d)) {
				sb.delete(sb.length() - d.length, sb.length());

			} else {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}

	static boolean isMatch(StringBuilder sb, char[] str) {
		if (sb.length() < str.length) {
			return false;
		}
		for (int i = 0; i < str.length; i++) {
			if (sb.charAt(sb.length() - str.length + i) != str[i]) {
				return false;
			}
		}
		return true;
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();

		char[] a = "dream".toCharArray();
		char[] b = "dreamer".toCharArray();
		char[] c = "erase".toCharArray();
		char[] d = "eraser".toCharArray();
		StringBuilder sb = new StringBuilder(s);

		while (sb.length() > 0) {
			if (isMatch(sb, a)) {
				sb.delete(sb.length() - a.length, sb.length());

			} else if (isMatch(sb, b)) {
				sb.delete(sb.length() - b.length, sb.length());

			} else if (isMatch(sb, c)) {
				sb.delete(sb.length() - c.length, sb.length());

			} else if (isMatch(sb, d)) {
				sb.delete(sb.length() - d.length, sb.length());

			} else {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}

	static boolean isMatch(StringBuilder sb, char[] str) {
		if (sb.length() < str.length) {
			return false;
		}
		for (int i = 0; i < str.length; i++) {
			if (sb.charAt(sb.length() - str.length + i) != str[i]) {
				return false;
			}
		}
		return true;
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();

		char[] a = "dream".toCharArray();
		char[] b = "dreamer".toCharArray();
		char[] c = "erase".toCharArray();
		char[] d = "eraser".toCharArray();
		StringBuilder sb = new StringBuilder(s);

		while (sb.length() > 0) {
			if (isMatch(sb, a)) {
				sb.delete(sb.length() - a.length, sb.length());

			} else if (isMatch(sb, b)) {
				sb.delete(sb.length() - b.length, sb.length());

			} else if (isMatch(sb, c)) {
				sb.delete(sb.length() - c.length, sb.length());

			} else if (isMatch(sb, d)) {
				sb.delete(sb.length() - d.length, sb.length());

			} else {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();

		char[] a = "dream".toCharArray();
		char[] b = "dreamer".toCharArray();
		char[] c = "erase".toCharArray();
		char[] d = "eraser".toCharArray();
		StringBuilder sb = new StringBuilder(s);

		while (sb.length() > 0) {
			if (isMatch(sb, a)) {
				sb.delete(sb.length() - a.length, sb.length());

			} else if (isMatch(sb, b)) {
				sb.delete(sb.length() - b.length, sb.length());

			} else if (isMatch(sb, c)) {
				sb.delete(sb.length() - c.length, sb.length());

			} else if (isMatch(sb, d)) {
				sb.delete(sb.length() - d.length, sb.length());

			} else {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc sc.close() sc.close sc char[] a = "dream".toCharArray(); a "dream".toCharArray() "dream".toCharArray "dream" char[] b = "dreamer".toCharArray(); b "dreamer".toCharArray() "dreamer".toCharArray "dreamer" char[] c = "erase".toCharArray(); c "erase".toCharArray() "erase".toCharArray "erase" char[] d = "eraser".toCharArray(); d "eraser".toCharArray() "eraser".toCharArray "eraser" StringBuilder sb = new StringBuilder(s); sb new StringBuilder(s) while (sb.length() > 0) {
			if (isMatch(sb, a)) {
				sb.delete(sb.length() - a.length, sb.length());

			} else if (isMatch(sb, b)) {
				sb.delete(sb.length() - b.length, sb.length());

			} else if (isMatch(sb, c)) {
				sb.delete(sb.length() - c.length, sb.length());

			} else if (isMatch(sb, d)) {
				sb.delete(sb.length() - d.length, sb.length());

			} else {
				System.out.println("NO");
				return;
			}
		} sb.length() > 0 sb.length() sb.length sb 0 {
			if (isMatch(sb, a)) {
				sb.delete(sb.length() - a.length, sb.length());

			} else if (isMatch(sb, b)) {
				sb.delete(sb.length() - b.length, sb.length());

			} else if (isMatch(sb, c)) {
				sb.delete(sb.length() - c.length, sb.length());

			} else if (isMatch(sb, d)) {
				sb.delete(sb.length() - d.length, sb.length());

			} else {
				System.out.println("NO");
				return;
			}
		} if (isMatch(sb, a)) {
				sb.delete(sb.length() - a.length, sb.length());

			} else if (isMatch(sb, b)) {
				sb.delete(sb.length() - b.length, sb.length());

			} else if (isMatch(sb, c)) {
				sb.delete(sb.length() - c.length, sb.length());

			} else if (isMatch(sb, d)) {
				sb.delete(sb.length() - d.length, sb.length());

			} else {
				System.out.println("NO");
				return;
			} isMatch(sb, a) isMatch sb a {
				sb.delete(sb.length() - a.length, sb.length());

			} sb.delete(sb.length() - a.length, sb.length()) sb.delete sb sb.length() - a.length sb.length() sb.length sb a.length a a.length sb.length() sb.length sb if (isMatch(sb, b)) {
				sb.delete(sb.length() - b.length, sb.length());

			} else if (isMatch(sb, c)) {
				sb.delete(sb.length() - c.length, sb.length());

			} else if (isMatch(sb, d)) {
				sb.delete(sb.length() - d.length, sb.length());

			} else {
				System.out.println("NO");
				return;
			} isMatch(sb, b) isMatch sb b {
				sb.delete(sb.length() - b.length, sb.length());

			} sb.delete(sb.length() - b.length, sb.length()) sb.delete sb sb.length() - b.length sb.length() sb.length sb b.length b b.length sb.length() sb.length sb if (isMatch(sb, c)) {
				sb.delete(sb.length() - c.length, sb.length());

			} else if (isMatch(sb, d)) {
				sb.delete(sb.length() - d.length, sb.length());

			} else {
				System.out.println("NO");
				return;
			} isMatch(sb, c) isMatch sb c {
				sb.delete(sb.length() - c.length, sb.length());

			} sb.delete(sb.length() - c.length, sb.length()) sb.delete sb sb.length() - c.length sb.length() sb.length sb c.length c c.length sb.length() sb.length sb if (isMatch(sb, d)) {
				sb.delete(sb.length() - d.length, sb.length());

			} else {
				System.out.println("NO");
				return;
			} isMatch(sb, d) isMatch sb d {
				sb.delete(sb.length() - d.length, sb.length());

			} sb.delete(sb.length() - d.length, sb.length()) sb.delete sb sb.length() - d.length sb.length() sb.length sb d.length d d.length sb.length() sb.length sb {
				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 static boolean isMatch(StringBuilder sb, char[] str) {
		if (sb.length() < str.length) {
			return false;
		}
		for (int i = 0; i < str.length; i++) {
			if (sb.charAt(sb.length() - str.length + i) != str[i]) {
				return false;
			}
		}
		return true;
	} isMatch {
		if (sb.length() < str.length) {
			return false;
		}
		for (int i = 0; i < str.length; i++) {
			if (sb.charAt(sb.length() - str.length + i) != str[i]) {
				return false;
			}
		}
		return true;
	} if (sb.length() < str.length) {
			return false;
		} sb.length() < str.length sb.length() sb.length sb str.length str str.length {
			return false;
		} return false; false for (int i = 0; i < str.length; i++) {
			if (sb.charAt(sb.length() - str.length + i) != str[i]) {
				return false;
			}
		} int i = 0; int i = 0; i 0 i < str.length i str.length str str.length i++ i++ i {
			if (sb.charAt(sb.length() - str.length + i) != str[i]) {
				return false;
			}
		} {
			if (sb.charAt(sb.length() - str.length + i) != str[i]) {
				return false;
			}
		} if (sb.charAt(sb.length() - str.length + i) != str[i]) {
				return false;
			} sb.charAt(sb.length() - str.length + i) != str[i] sb.charAt(sb.length() - str.length + i) sb.charAt sb sb.length() - str.length + i sb.length() - str.length sb.length() sb.length sb str.length str str.length i str[i] str i {
				return false;
			} return false; false return true; true StringBuilder sb sb char[] str str public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();

		char[] a = "dream".toCharArray();
		char[] b = "dreamer".toCharArray();
		char[] c = "erase".toCharArray();
		char[] d = "eraser".toCharArray();
		StringBuilder sb = new StringBuilder(s);

		while (sb.length() > 0) {
			if (isMatch(sb, a)) {
				sb.delete(sb.length() - a.length, sb.length());

			} else if (isMatch(sb, b)) {
				sb.delete(sb.length() - b.length, sb.length());

			} else if (isMatch(sb, c)) {
				sb.delete(sb.length() - c.length, sb.length());

			} else if (isMatch(sb, d)) {
				sb.delete(sb.length() - d.length, sb.length());

			} else {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}

	static boolean isMatch(StringBuilder sb, char[] str) {
		if (sb.length() < str.length) {
			return false;
		}
		for (int i = 0; i < str.length; i++) {
			if (sb.charAt(sb.length() - str.length + i) != str[i]) {
				return false;
			}
		}
		return true;
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();

		char[] a = "dream".toCharArray();
		char[] b = "dreamer".toCharArray();
		char[] c = "erase".toCharArray();
		char[] d = "eraser".toCharArray();
		StringBuilder sb = new StringBuilder(s);

		while (sb.length() > 0) {
			if (isMatch(sb, a)) {
				sb.delete(sb.length() - a.length, sb.length());

			} else if (isMatch(sb, b)) {
				sb.delete(sb.length() - b.length, sb.length());

			} else if (isMatch(sb, c)) {
				sb.delete(sb.length() - c.length, sb.length());

			} else if (isMatch(sb, d)) {
				sb.delete(sb.length() - d.length, sb.length());

			} else {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}

	static boolean isMatch(StringBuilder sb, char[] str) {
		if (sb.length() < str.length) {
			return false;
		}
		for (int i = 0; i < str.length; i++) {
			if (sb.charAt(sb.length() - str.length + i) != str[i]) {
				return false;
			}
		}
		return true;
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();

		char[] a = "dream".toCharArray();
		char[] b = "dreamer".toCharArray();
		char[] c = "erase".toCharArray();
		char[] d = "eraser".toCharArray();
		StringBuilder sb = new StringBuilder(s);

		while (sb.length() > 0) {
			if (isMatch(sb, a)) {
				sb.delete(sb.length() - a.length, sb.length());

			} else if (isMatch(sb, b)) {
				sb.delete(sb.length() - b.length, sb.length());

			} else if (isMatch(sb, c)) {
				sb.delete(sb.length() - c.length, sb.length());

			} else if (isMatch(sb, d)) {
				sb.delete(sb.length() - d.length, sb.length());

			} else {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}

	static boolean isMatch(StringBuilder sb, char[] str) {
		if (sb.length() < str.length) {
			return false;
		}
		for (int i = 0; i < str.length; i++) {
			if (sb.charAt(sb.length() - str.length + i) != str[i]) {
				return false;
			}
		}
		return true;
	}
}
