import java.util.Scanner;

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

		sb.reverse();
		String s = sb.toString();
		int n = s.length();
		String[] sa = {"maerd", "remaerd", "esare", "resare"};
		int idx = 0;
		while (idx < n) {
			boolean flg = false;
			for (int i = 0; i < sa.length; i++) {
				if (s.indexOf(sa[i], idx) == idx) {
					idx += sa[i].length();
					flg = true;
					break;
				}
			}
			if (!flg) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder(sc.next());
		sc.close();

		sb.reverse();
		String s = sb.toString();
		int n = s.length();
		String[] sa = {"maerd", "remaerd", "esare", "resare"};
		int idx = 0;
		while (idx < n) {
			boolean flg = false;
			for (int i = 0; i < sa.length; i++) {
				if (s.indexOf(sa[i], idx) == idx) {
					idx += sa[i].length();
					flg = true;
					break;
				}
			}
			if (!flg) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder(sc.next());
		sc.close();

		sb.reverse();
		String s = sb.toString();
		int n = s.length();
		String[] sa = {"maerd", "remaerd", "esare", "resare"};
		int idx = 0;
		while (idx < n) {
			boolean flg = false;
			for (int i = 0; i < sa.length; i++) {
				if (s.indexOf(sa[i], idx) == idx) {
					idx += sa[i].length();
					flg = true;
					break;
				}
			}
			if (!flg) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	} main {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder(sc.next());
		sc.close();

		sb.reverse();
		String s = sb.toString();
		int n = s.length();
		String[] sa = {"maerd", "remaerd", "esare", "resare"};
		int idx = 0;
		while (idx < n) {
			boolean flg = false;
			for (int i = 0; i < sa.length; i++) {
				if (s.indexOf(sa[i], idx) == idx) {
					idx += sa[i].length();
					flg = true;
					break;
				}
			}
			if (!flg) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder sb = new StringBuilder(sc.next()); sb new StringBuilder(sc.next()) sc.close() sc.close sc sb.reverse() sb.reverse sb String s = sb.toString(); s sb.toString() sb.toString sb int n = s.length(); n s.length() s.length s String[] sa = {"maerd", "remaerd", "esare", "resare"}; sa {"maerd", "remaerd", "esare", "resare"} "maerd" "remaerd" "esare" "resare" int idx = 0; idx 0 while (idx < n) {
			boolean flg = false;
			for (int i = 0; i < sa.length; i++) {
				if (s.indexOf(sa[i], idx) == idx) {
					idx += sa[i].length();
					flg = true;
					break;
				}
			}
			if (!flg) {
				System.out.println("NO");
				return;
			}
		} idx < n idx n {
			boolean flg = false;
			for (int i = 0; i < sa.length; i++) {
				if (s.indexOf(sa[i], idx) == idx) {
					idx += sa[i].length();
					flg = true;
					break;
				}
			}
			if (!flg) {
				System.out.println("NO");
				return;
			}
		} boolean flg = false; flg false for (int i = 0; i < sa.length; i++) {
				if (s.indexOf(sa[i], idx) == idx) {
					idx += sa[i].length();
					flg = true;
					break;
				}
			} int i = 0; int i = 0; i 0 i < sa.length i sa.length sa sa.length i++ i++ i {
				if (s.indexOf(sa[i], idx) == idx) {
					idx += sa[i].length();
					flg = true;
					break;
				}
			} {
				if (s.indexOf(sa[i], idx) == idx) {
					idx += sa[i].length();
					flg = true;
					break;
				}
			} if (s.indexOf(sa[i], idx) == idx) {
					idx += sa[i].length();
					flg = true;
					break;
				} s.indexOf(sa[i], idx) == idx s.indexOf(sa[i], idx) s.indexOf s sa[i] sa i idx idx {
					idx += sa[i].length();
					flg = true;
					break;
				} idx += sa[i].length() idx sa[i].length() sa[i].length sa[i] sa i flg = true flg true break; if (!flg) {
				System.out.println("NO");
				return;
			} !flg flg {
				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 public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder(sc.next());
		sc.close();

		sb.reverse();
		String s = sb.toString();
		int n = s.length();
		String[] sa = {"maerd", "remaerd", "esare", "resare"};
		int idx = 0;
		while (idx < n) {
			boolean flg = false;
			for (int i = 0; i < sa.length; i++) {
				if (s.indexOf(sa[i], idx) == idx) {
					idx += sa[i].length();
					flg = true;
					break;
				}
			}
			if (!flg) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder(sc.next());
		sc.close();

		sb.reverse();
		String s = sb.toString();
		int n = s.length();
		String[] sa = {"maerd", "remaerd", "esare", "resare"};
		int idx = 0;
		while (idx < n) {
			boolean flg = false;
			for (int i = 0; i < sa.length; i++) {
				if (s.indexOf(sa[i], idx) == idx) {
					idx += sa[i].length();
					flg = true;
					break;
				}
			}
			if (!flg) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}
} Main
import java.util.Scanner;

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

		sb.reverse();
		String s = sb.toString();
		int n = s.length();
		String[] sa = {"maerd", "remaerd", "esare", "resare"};
		int idx = 0;
		while (idx < n) {
			boolean flg = false;
			for (int i = 0; i < sa.length; i++) {
				if (s.indexOf(sa[i], idx) == idx) {
					idx += sa[i].length();
					flg = true;
					break;
				}
			}
			if (!flg) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}
}
