import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuffer str = new StringBuffer(sc.next());
		String S = str.reverse().toString();
		sc.close();
		System.out.println(solve(S));
	}
	
	public static String solve(String S) {
		int index = 0;
		while(index+5<S.length()) {
			if(S.substring(index,index+5).equals("esare")) {
				index += 5;
			}else if(S.substring(index,index+5).equals("maerd")) {
				index += 5;
			}else if(S.substring(index,index+6).equals("resare")) {
				index += 6;
			}else if(S.substring(index,index+7).equals("remaerd")) {
				index += 7;
			}else {
				return "NO";
			}
		}
		return "YES";
	}
} import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuffer str = new StringBuffer(sc.next());
		String S = str.reverse().toString();
		sc.close();
		System.out.println(solve(S));
	}
	
	public static String solve(String S) {
		int index = 0;
		while(index+5<S.length()) {
			if(S.substring(index,index+5).equals("esare")) {
				index += 5;
			}else if(S.substring(index,index+5).equals("maerd")) {
				index += 5;
			}else if(S.substring(index,index+6).equals("resare")) {
				index += 6;
			}else if(S.substring(index,index+7).equals("remaerd")) {
				index += 7;
			}else {
				return "NO";
			}
		}
		return "YES";
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuffer str = new StringBuffer(sc.next());
		String S = str.reverse().toString();
		sc.close();
		System.out.println(solve(S));
	} main {
		Scanner sc = new Scanner(System.in);
		StringBuffer str = new StringBuffer(sc.next());
		String S = str.reverse().toString();
		sc.close();
		System.out.println(solve(S));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuffer str = new StringBuffer(sc.next()); str new StringBuffer(sc.next()) String S = str.reverse().toString(); S str.reverse().toString() str.reverse().toString str.reverse() str.reverse str sc.close() sc.close sc System.out.println(solve(S)) System.out.println System.out System System.out solve(S) solve S String[] args args public static String solve(String S) {
		int index = 0;
		while(index+5<S.length()) {
			if(S.substring(index,index+5).equals("esare")) {
				index += 5;
			}else if(S.substring(index,index+5).equals("maerd")) {
				index += 5;
			}else if(S.substring(index,index+6).equals("resare")) {
				index += 6;
			}else if(S.substring(index,index+7).equals("remaerd")) {
				index += 7;
			}else {
				return "NO";
			}
		}
		return "YES";
	} solve {
		int index = 0;
		while(index+5<S.length()) {
			if(S.substring(index,index+5).equals("esare")) {
				index += 5;
			}else if(S.substring(index,index+5).equals("maerd")) {
				index += 5;
			}else if(S.substring(index,index+6).equals("resare")) {
				index += 6;
			}else if(S.substring(index,index+7).equals("remaerd")) {
				index += 7;
			}else {
				return "NO";
			}
		}
		return "YES";
	} int index = 0; index 0 while(index+5<S.length()) {
			if(S.substring(index,index+5).equals("esare")) {
				index += 5;
			}else if(S.substring(index,index+5).equals("maerd")) {
				index += 5;
			}else if(S.substring(index,index+6).equals("resare")) {
				index += 6;
			}else if(S.substring(index,index+7).equals("remaerd")) {
				index += 7;
			}else {
				return "NO";
			}
		} index+5<S.length() index+5 index 5 S.length() S.length S {
			if(S.substring(index,index+5).equals("esare")) {
				index += 5;
			}else if(S.substring(index,index+5).equals("maerd")) {
				index += 5;
			}else if(S.substring(index,index+6).equals("resare")) {
				index += 6;
			}else if(S.substring(index,index+7).equals("remaerd")) {
				index += 7;
			}else {
				return "NO";
			}
		} if(S.substring(index,index+5).equals("esare")) {
				index += 5;
			}else if(S.substring(index,index+5).equals("maerd")) {
				index += 5;
			}else if(S.substring(index,index+6).equals("resare")) {
				index += 6;
			}else if(S.substring(index,index+7).equals("remaerd")) {
				index += 7;
			}else {
				return "NO";
			} S.substring(index,index+5).equals("esare") S.substring(index,index+5).equals S.substring(index,index+5) S.substring S index index+5 index 5 "esare" {
				index += 5;
			} index += 5 index 5 if(S.substring(index,index+5).equals("maerd")) {
				index += 5;
			}else if(S.substring(index,index+6).equals("resare")) {
				index += 6;
			}else if(S.substring(index,index+7).equals("remaerd")) {
				index += 7;
			}else {
				return "NO";
			} S.substring(index,index+5).equals("maerd") S.substring(index,index+5).equals S.substring(index,index+5) S.substring S index index+5 index 5 "maerd" {
				index += 5;
			} index += 5 index 5 if(S.substring(index,index+6).equals("resare")) {
				index += 6;
			}else if(S.substring(index,index+7).equals("remaerd")) {
				index += 7;
			}else {
				return "NO";
			} S.substring(index,index+6).equals("resare") S.substring(index,index+6).equals S.substring(index,index+6) S.substring S index index+6 index 6 "resare" {
				index += 6;
			} index += 6 index 6 if(S.substring(index,index+7).equals("remaerd")) {
				index += 7;
			}else {
				return "NO";
			} S.substring(index,index+7).equals("remaerd") S.substring(index,index+7).equals S.substring(index,index+7) S.substring S index index+7 index 7 "remaerd" {
				index += 7;
			} index += 7 index 7 {
				return "NO";
			} return "NO"; "NO" return "YES"; "YES" String S S public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuffer str = new StringBuffer(sc.next());
		String S = str.reverse().toString();
		sc.close();
		System.out.println(solve(S));
	}
	
	public static String solve(String S) {
		int index = 0;
		while(index+5<S.length()) {
			if(S.substring(index,index+5).equals("esare")) {
				index += 5;
			}else if(S.substring(index,index+5).equals("maerd")) {
				index += 5;
			}else if(S.substring(index,index+6).equals("resare")) {
				index += 6;
			}else if(S.substring(index,index+7).equals("remaerd")) {
				index += 7;
			}else {
				return "NO";
			}
		}
		return "YES";
	}
} public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuffer str = new StringBuffer(sc.next());
		String S = str.reverse().toString();
		sc.close();
		System.out.println(solve(S));
	}
	
	public static String solve(String S) {
		int index = 0;
		while(index+5<S.length()) {
			if(S.substring(index,index+5).equals("esare")) {
				index += 5;
			}else if(S.substring(index,index+5).equals("maerd")) {
				index += 5;
			}else if(S.substring(index,index+6).equals("resare")) {
				index += 6;
			}else if(S.substring(index,index+7).equals("remaerd")) {
				index += 7;
			}else {
				return "NO";
			}
		}
		return "YES";
	}
} Main
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuffer str = new StringBuffer(sc.next());
		String S = str.reverse().toString();
		sc.close();
		System.out.println(solve(S));
	}
	
	public static String solve(String S) {
		int index = 0;
		while(index+5<S.length()) {
			if(S.substring(index,index+5).equals("esare")) {
				index += 5;
			}else if(S.substring(index,index+5).equals("maerd")) {
				index += 5;
			}else if(S.substring(index,index+6).equals("resare")) {
				index += 6;
			}else if(S.substring(index,index+7).equals("remaerd")) {
				index += 7;
			}else {
				return "NO";
			}
		}
		return "YES";
	}
}