import java.util.Scanner;

class Main {
	String s;
	String[] d = { "maerd", "remaerd", "esare", "resare" };

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Main m = new Main(sc);
		m.solve();
		sc.close();
	}

	Main(Scanner sc) {
		s = sc.next();
	}

	void solve() {
		StringBuffer sb = new StringBuffer(s);
		sb.reverse();
		first: while (sb.length() >= 5) {
			for (int i = 0; i < 4; i++) {
				if (d[i].length() <= sb.length()) {
					if (d[i].equals(sb.substring(0, d[i].length()))) {
						sb.delete(0, d[i].length());
						break;
					}
				}
				if (i == 3) {
					break first;
				}
			}
		}
		if (sb.length() == 0) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
} import java.util.Scanner; Scanner java.util class Main {
	String s;
	String[] d = { "maerd", "remaerd", "esare", "resare" };

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Main m = new Main(sc);
		m.solve();
		sc.close();
	}

	Main(Scanner sc) {
		s = sc.next();
	}

	void solve() {
		StringBuffer sb = new StringBuffer(s);
		sb.reverse();
		first: while (sb.length() >= 5) {
			for (int i = 0; i < 4; i++) {
				if (d[i].length() <= sb.length()) {
					if (d[i].equals(sb.substring(0, d[i].length()))) {
						sb.delete(0, d[i].length());
						break;
					}
				}
				if (i == 3) {
					break first;
				}
			}
		}
		if (sb.length() == 0) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
} Main String s; s String[] d = { "maerd", "remaerd", "esare", "resare" }; d { "maerd", "remaerd", "esare", "resare" } "maerd" "remaerd" "esare" "resare" public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Main m = new Main(sc);
		m.solve();
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		Main m = new Main(sc);
		m.solve();
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Main m = new Main(sc); m new Main(sc) m.solve() m.solve m sc.close() sc.close sc String[] args args Main(Scanner sc) {
		s = sc.next();
	} Main {
		s = sc.next();
	} s = sc.next() s sc.next() sc.next sc Scanner sc sc void solve() {
		StringBuffer sb = new StringBuffer(s);
		sb.reverse();
		first: while (sb.length() >= 5) {
			for (int i = 0; i < 4; i++) {
				if (d[i].length() <= sb.length()) {
					if (d[i].equals(sb.substring(0, d[i].length()))) {
						sb.delete(0, d[i].length());
						break;
					}
				}
				if (i == 3) {
					break first;
				}
			}
		}
		if (sb.length() == 0) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	} solve {
		StringBuffer sb = new StringBuffer(s);
		sb.reverse();
		first: while (sb.length() >= 5) {
			for (int i = 0; i < 4; i++) {
				if (d[i].length() <= sb.length()) {
					if (d[i].equals(sb.substring(0, d[i].length()))) {
						sb.delete(0, d[i].length());
						break;
					}
				}
				if (i == 3) {
					break first;
				}
			}
		}
		if (sb.length() == 0) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	} StringBuffer sb = new StringBuffer(s); sb new StringBuffer(s) sb.reverse() sb.reverse sb if (sb.length() == 0) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		} sb.length() == 0 sb.length() sb.length sb 0 {
			System.out.println("YES");
		} System.out.println("YES") System.out.println System.out System System.out "YES" {
			System.out.println("NO");
		} System.out.println("NO") System.out.println System.out System System.out "NO"
import java.util.Scanner;

class Main {
	String s;
	String[] d = { "maerd", "remaerd", "esare", "resare" };

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Main m = new Main(sc);
		m.solve();
		sc.close();
	}

	Main(Scanner sc) {
		s = sc.next();
	}

	void solve() {
		StringBuffer sb = new StringBuffer(s);
		sb.reverse();
		first: while (sb.length() >= 5) {
			for (int i = 0; i < 4; i++) {
				if (d[i].length() <= sb.length()) {
					if (d[i].equals(sb.substring(0, d[i].length()))) {
						sb.delete(0, d[i].length());
						break;
					}
				}
				if (i == 3) {
					break first;
				}
			}
		}
		if (sb.length() == 0) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
}