import java.io.PrintWriter;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
      	Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		String S = new StringBuffer(sc.next()).reverse().toString();
		boolean flg = false;

		String[] keywords = {"maerd", "remaerd", "esare", "resare"};
		int currentI = 0;
		while (true) {
			for (String keyword: keywords) {
				int index = S.indexOf(keyword, currentI);
				if (index == currentI) {
					currentI += keyword.length();
					flg = true;
					break;
				}
			}

			if (currentI == S.length()) {
				out.println("YES");
				break;
			}

			if (flg) {
				flg = false;
			} else {
				out.println("NO");
				break;
			}
		}

		out.flush();
	}
} import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
      	Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		String S = new StringBuffer(sc.next()).reverse().toString();
		boolean flg = false;

		String[] keywords = {"maerd", "remaerd", "esare", "resare"};
		int currentI = 0;
		while (true) {
			for (String keyword: keywords) {
				int index = S.indexOf(keyword, currentI);
				if (index == currentI) {
					currentI += keyword.length();
					flg = true;
					break;
				}
			}

			if (currentI == S.length()) {
				out.println("YES");
				break;
			}

			if (flg) {
				flg = false;
			} else {
				out.println("NO");
				break;
			}
		}

		out.flush();
	}
} Main public static void main(String[] args) {
      	Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		String S = new StringBuffer(sc.next()).reverse().toString();
		boolean flg = false;

		String[] keywords = {"maerd", "remaerd", "esare", "resare"};
		int currentI = 0;
		while (true) {
			for (String keyword: keywords) {
				int index = S.indexOf(keyword, currentI);
				if (index == currentI) {
					currentI += keyword.length();
					flg = true;
					break;
				}
			}

			if (currentI == S.length()) {
				out.println("YES");
				break;
			}

			if (flg) {
				flg = false;
			} else {
				out.println("NO");
				break;
			}
		}

		out.flush();
	} main {
      	Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		String S = new StringBuffer(sc.next()).reverse().toString();
		boolean flg = false;

		String[] keywords = {"maerd", "remaerd", "esare", "resare"};
		int currentI = 0;
		while (true) {
			for (String keyword: keywords) {
				int index = S.indexOf(keyword, currentI);
				if (index == currentI) {
					currentI += keyword.length();
					flg = true;
					break;
				}
			}

			if (currentI == S.length()) {
				out.println("YES");
				break;
			}

			if (flg) {
				flg = false;
			} else {
				out.println("NO");
				break;
			}
		}

		out.flush();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) String S = new StringBuffer(sc.next()).reverse().toString(); S new StringBuffer(sc.next()).reverse().toString() new StringBuffer(sc.next()).reverse().toString new StringBuffer(sc.next()).reverse() new StringBuffer(sc.next()).reverse new StringBuffer(sc.next()) boolean flg = false; flg false String[] keywords = {"maerd", "remaerd", "esare", "resare"}; keywords {"maerd", "remaerd", "esare", "resare"} "maerd" "remaerd" "esare" "resare" int currentI = 0; currentI 0 while (true) {
			for (String keyword: keywords) {
				int index = S.indexOf(keyword, currentI);
				if (index == currentI) {
					currentI += keyword.length();
					flg = true;
					break;
				}
			}

			if (currentI == S.length()) {
				out.println("YES");
				break;
			}

			if (flg) {
				flg = false;
			} else {
				out.println("NO");
				break;
			}
		} true {
			for (String keyword: keywords) {
				int index = S.indexOf(keyword, currentI);
				if (index == currentI) {
					currentI += keyword.length();
					flg = true;
					break;
				}
			}

			if (currentI == S.length()) {
				out.println("YES");
				break;
			}

			if (flg) {
				flg = false;
			} else {
				out.println("NO");
				break;
			}
		} for (String keyword: keywords) {
				int index = S.indexOf(keyword, currentI);
				if (index == currentI) {
					currentI += keyword.length();
					flg = true;
					break;
				}
			} String keyword keywords {
				int index = S.indexOf(keyword, currentI);
				if (index == currentI) {
					currentI += keyword.length();
					flg = true;
					break;
				}
			} {
				int index = S.indexOf(keyword, currentI);
				if (index == currentI) {
					currentI += keyword.length();
					flg = true;
					break;
				}
			} int index = S.indexOf(keyword, currentI); index S.indexOf(keyword, currentI) S.indexOf S keyword currentI if (index == currentI) {
					currentI += keyword.length();
					flg = true;
					break;
				} index == currentI index currentI {
					currentI += keyword.length();
					flg = true;
					break;
				} currentI += keyword.length() currentI keyword.length() keyword.length keyword flg = true flg true break; if (currentI == S.length()) {
				out.println("YES");
				break;
			} currentI == S.length() currentI S.length() S.length S {
				out.println("YES");
				break;
			} out.println("YES") out.println out "YES" break; if (flg) {
				flg = false;
			} else {
				out.println("NO");
				break;
			} flg {
				flg = false;
			} flg = false flg false {
				out.println("NO");
				break;
			} out.println("NO") out.println out "NO" break; out.flush() out.flush out String[] args args public class Main {
	public static void main(String[] args) {
      	Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		String S = new StringBuffer(sc.next()).reverse().toString();
		boolean flg = false;

		String[] keywords = {"maerd", "remaerd", "esare", "resare"};
		int currentI = 0;
		while (true) {
			for (String keyword: keywords) {
				int index = S.indexOf(keyword, currentI);
				if (index == currentI) {
					currentI += keyword.length();
					flg = true;
					break;
				}
			}

			if (currentI == S.length()) {
				out.println("YES");
				break;
			}

			if (flg) {
				flg = false;
			} else {
				out.println("NO");
				break;
			}
		}

		out.flush();
	}
} public class Main {
	public static void main(String[] args) {
      	Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		String S = new StringBuffer(sc.next()).reverse().toString();
		boolean flg = false;

		String[] keywords = {"maerd", "remaerd", "esare", "resare"};
		int currentI = 0;
		while (true) {
			for (String keyword: keywords) {
				int index = S.indexOf(keyword, currentI);
				if (index == currentI) {
					currentI += keyword.length();
					flg = true;
					break;
				}
			}

			if (currentI == S.length()) {
				out.println("YES");
				break;
			}

			if (flg) {
				flg = false;
			} else {
				out.println("NO");
				break;
			}
		}

		out.flush();
	}
} Main
import java.io.PrintWriter;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
      	Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		String S = new StringBuffer(sc.next()).reverse().toString();
		boolean flg = false;

		String[] keywords = {"maerd", "remaerd", "esare", "resare"};
		int currentI = 0;
		while (true) {
			for (String keyword: keywords) {
				int index = S.indexOf(keyword, currentI);
				if (index == currentI) {
					currentI += keyword.length();
					flg = true;
					break;
				}
			}

			if (currentI == S.length()) {
				out.println("YES");
				break;
			}

			if (flg) {
				flg = false;
			} else {
				out.println("NO");
				break;
			}
		}

		out.flush();
	}
}