import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.nextLine();
		
		StringBuffer sb = new StringBuffer(S);
		
		S = sb.reverse().toString();
		
		String[] word = {"maerd", "remaerd", "esare", "resare"};
		
		boolean canDivide = false;
		for(int i = 0; i < S.length();) {
			for(int j = 0; j < word.length; j ++) {
				canDivide = false;
				if(i + word[j].length() <= S.length()) {
					if(S.substring(i, i + word[j].length()).equals(word[j])) {
						canDivide = true;
						i += word[j].length();
						break;
					}
				}
			}
			if(!canDivide) {
				break;
			}
		}
		
		if(canDivide) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.nextLine();
		
		StringBuffer sb = new StringBuffer(S);
		
		S = sb.reverse().toString();
		
		String[] word = {"maerd", "remaerd", "esare", "resare"};
		
		boolean canDivide = false;
		for(int i = 0; i < S.length();) {
			for(int j = 0; j < word.length; j ++) {
				canDivide = false;
				if(i + word[j].length() <= S.length()) {
					if(S.substring(i, i + word[j].length()).equals(word[j])) {
						canDivide = true;
						i += word[j].length();
						break;
					}
				}
			}
			if(!canDivide) {
				break;
			}
		}
		
		if(canDivide) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.nextLine();
		
		StringBuffer sb = new StringBuffer(S);
		
		S = sb.reverse().toString();
		
		String[] word = {"maerd", "remaerd", "esare", "resare"};
		
		boolean canDivide = false;
		for(int i = 0; i < S.length();) {
			for(int j = 0; j < word.length; j ++) {
				canDivide = false;
				if(i + word[j].length() <= S.length()) {
					if(S.substring(i, i + word[j].length()).equals(word[j])) {
						canDivide = true;
						i += word[j].length();
						break;
					}
				}
			}
			if(!canDivide) {
				break;
			}
		}
		
		if(canDivide) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	} main {
		// TODO Auto-generated method stub
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.nextLine();
		
		StringBuffer sb = new StringBuffer(S);
		
		S = sb.reverse().toString();
		
		String[] word = {"maerd", "remaerd", "esare", "resare"};
		
		boolean canDivide = false;
		for(int i = 0; i < S.length();) {
			for(int j = 0; j < word.length; j ++) {
				canDivide = false;
				if(i + word[j].length() <= S.length()) {
					if(S.substring(i, i + word[j].length()).equals(word[j])) {
						canDivide = true;
						i += word[j].length();
						break;
					}
				}
			}
			if(!canDivide) {
				break;
			}
		}
		
		if(canDivide) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) String S = stdIn.nextLine(); S stdIn.nextLine() stdIn.nextLine stdIn StringBuffer sb = new StringBuffer(S); sb new StringBuffer(S) S = sb.reverse().toString() S sb.reverse().toString() sb.reverse().toString sb.reverse() sb.reverse sb String[] word = {"maerd", "remaerd", "esare", "resare"}; word {"maerd", "remaerd", "esare", "resare"} "maerd" "remaerd" "esare" "resare" boolean canDivide = false; canDivide false for(int i = 0; i < S.length();) {
			for(int j = 0; j < word.length; j ++) {
				canDivide = false;
				if(i + word[j].length() <= S.length()) {
					if(S.substring(i, i + word[j].length()).equals(word[j])) {
						canDivide = true;
						i += word[j].length();
						break;
					}
				}
			}
			if(!canDivide) {
				break;
			}
		} int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S {
			for(int j = 0; j < word.length; j ++) {
				canDivide = false;
				if(i + word[j].length() <= S.length()) {
					if(S.substring(i, i + word[j].length()).equals(word[j])) {
						canDivide = true;
						i += word[j].length();
						break;
					}
				}
			}
			if(!canDivide) {
				break;
			}
		} {
			for(int j = 0; j < word.length; j ++) {
				canDivide = false;
				if(i + word[j].length() <= S.length()) {
					if(S.substring(i, i + word[j].length()).equals(word[j])) {
						canDivide = true;
						i += word[j].length();
						break;
					}
				}
			}
			if(!canDivide) {
				break;
			}
		} for(int j = 0; j < word.length; j ++) {
				canDivide = false;
				if(i + word[j].length() <= S.length()) {
					if(S.substring(i, i + word[j].length()).equals(word[j])) {
						canDivide = true;
						i += word[j].length();
						break;
					}
				}
			} int j = 0; int j = 0; j 0 j < word.length j word.length word word.length j ++ j ++ j {
				canDivide = false;
				if(i + word[j].length() <= S.length()) {
					if(S.substring(i, i + word[j].length()).equals(word[j])) {
						canDivide = true;
						i += word[j].length();
						break;
					}
				}
			} {
				canDivide = false;
				if(i + word[j].length() <= S.length()) {
					if(S.substring(i, i + word[j].length()).equals(word[j])) {
						canDivide = true;
						i += word[j].length();
						break;
					}
				}
			} canDivide = false canDivide false if(i + word[j].length() <= S.length()) {
					if(S.substring(i, i + word[j].length()).equals(word[j])) {
						canDivide = true;
						i += word[j].length();
						break;
					}
				} i + word[j].length() <= S.length() i + word[j].length() i word[j].length() word[j].length word[j] word j S.length() S.length S {
					if(S.substring(i, i + word[j].length()).equals(word[j])) {
						canDivide = true;
						i += word[j].length();
						break;
					}
				} if(S.substring(i, i + word[j].length()).equals(word[j])) {
						canDivide = true;
						i += word[j].length();
						break;
					} S.substring(i, i + word[j].length()).equals(word[j]) S.substring(i, i + word[j].length()).equals S.substring(i, i + word[j].length()) S.substring S i i + word[j].length() i word[j].length() word[j].length word[j] word j word[j] word j {
						canDivide = true;
						i += word[j].length();
						break;
					} canDivide = true canDivide true i += word[j].length() i word[j].length() word[j].length word[j] word j break; if(!canDivide) {
				break;
			} !canDivide canDivide {
				break;
			} break; if(canDivide) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		} canDivide {
			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" String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.nextLine();
		
		StringBuffer sb = new StringBuffer(S);
		
		S = sb.reverse().toString();
		
		String[] word = {"maerd", "remaerd", "esare", "resare"};
		
		boolean canDivide = false;
		for(int i = 0; i < S.length();) {
			for(int j = 0; j < word.length; j ++) {
				canDivide = false;
				if(i + word[j].length() <= S.length()) {
					if(S.substring(i, i + word[j].length()).equals(word[j])) {
						canDivide = true;
						i += word[j].length();
						break;
					}
				}
			}
			if(!canDivide) {
				break;
			}
		}
		
		if(canDivide) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.nextLine();
		
		StringBuffer sb = new StringBuffer(S);
		
		S = sb.reverse().toString();
		
		String[] word = {"maerd", "remaerd", "esare", "resare"};
		
		boolean canDivide = false;
		for(int i = 0; i < S.length();) {
			for(int j = 0; j < word.length; j ++) {
				canDivide = false;
				if(i + word[j].length() <= S.length()) {
					if(S.substring(i, i + word[j].length()).equals(word[j])) {
						canDivide = true;
						i += word[j].length();
						break;
					}
				}
			}
			if(!canDivide) {
				break;
			}
		}
		
		if(canDivide) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.nextLine();
		
		StringBuffer sb = new StringBuffer(S);
		
		S = sb.reverse().toString();
		
		String[] word = {"maerd", "remaerd", "esare", "resare"};
		
		boolean canDivide = false;
		for(int i = 0; i < S.length();) {
			for(int j = 0; j < word.length; j ++) {
				canDivide = false;
				if(i + word[j].length() <= S.length()) {
					if(S.substring(i, i + word[j].length()).equals(word[j])) {
						canDivide = true;
						i += word[j].length();
						break;
					}
				}
			}
			if(!canDivide) {
				break;
			}
		}
		
		if(canDivide) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}

}