import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
			String S = sc.next();
		sc.close();


		StringBuffer sb = new StringBuffer(S);
		String T = sb.reverse().toString();

		//System.out.println(T);

		boolean flag = true;
		for(int i = 0 ; i < T.length() ; i++){
			if(i+5 <=T.length() && (T.substring(i, i+5).equals("maerd") ||T.substring(i, i+5).equals("esare"))){
				//System.out.println(T.substring(i, i+5));
				i +=4;

			}
			else if(i+6<=T.length() && T.substring(i, i+6).equals("resare")){
				//System.out.println(T.substring(i, i+6));
				i += 5;

			}
			else if(i+7<=T.length() && T.substring(i, i+7).equals("remaerd")){
				//System.out.println(T.substring(i, i+7));
				i += 6;

			}

			else{
				flag = false;
				break;
			}
		}

		if(flag){
			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) {
		Scanner sc = new Scanner(System.in);
			String S = sc.next();
		sc.close();


		StringBuffer sb = new StringBuffer(S);
		String T = sb.reverse().toString();

		//System.out.println(T);

		boolean flag = true;
		for(int i = 0 ; i < T.length() ; i++){
			if(i+5 <=T.length() && (T.substring(i, i+5).equals("maerd") ||T.substring(i, i+5).equals("esare"))){
				//System.out.println(T.substring(i, i+5));
				i +=4;

			}
			else if(i+6<=T.length() && T.substring(i, i+6).equals("resare")){
				//System.out.println(T.substring(i, i+6));
				i += 5;

			}
			else if(i+7<=T.length() && T.substring(i, i+7).equals("remaerd")){
				//System.out.println(T.substring(i, i+7));
				i += 6;

			}

			else{
				flag = false;
				break;
			}
		}

		if(flag){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
			String S = sc.next();
		sc.close();


		StringBuffer sb = new StringBuffer(S);
		String T = sb.reverse().toString();

		//System.out.println(T);

		boolean flag = true;
		for(int i = 0 ; i < T.length() ; i++){
			if(i+5 <=T.length() && (T.substring(i, i+5).equals("maerd") ||T.substring(i, i+5).equals("esare"))){
				//System.out.println(T.substring(i, i+5));
				i +=4;

			}
			else if(i+6<=T.length() && T.substring(i, i+6).equals("resare")){
				//System.out.println(T.substring(i, i+6));
				i += 5;

			}
			else if(i+7<=T.length() && T.substring(i, i+7).equals("remaerd")){
				//System.out.println(T.substring(i, i+7));
				i += 6;

			}

			else{
				flag = false;
				break;
			}
		}

		if(flag){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		}
	} main {
		Scanner sc = new Scanner(System.in);
			String S = sc.next();
		sc.close();


		StringBuffer sb = new StringBuffer(S);
		String T = sb.reverse().toString();

		//System.out.println(T);

		boolean flag = true;
		for(int i = 0 ; i < T.length() ; i++){
			if(i+5 <=T.length() && (T.substring(i, i+5).equals("maerd") ||T.substring(i, i+5).equals("esare"))){
				//System.out.println(T.substring(i, i+5));
				i +=4;

			}
			else if(i+6<=T.length() && T.substring(i, i+6).equals("resare")){
				//System.out.println(T.substring(i, i+6));
				i += 5;

			}
			else if(i+7<=T.length() && T.substring(i, i+7).equals("remaerd")){
				//System.out.println(T.substring(i, i+7));
				i += 6;

			}

			else{
				flag = false;
				break;
			}
		}

		if(flag){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc sc.close() sc.close sc StringBuffer sb = new StringBuffer(S); sb new StringBuffer(S) String T = sb.reverse().toString(); T sb.reverse().toString() sb.reverse().toString sb.reverse() sb.reverse sb boolean flag = true; flag true for(int i = 0 ; i < T.length() ; i++){
			if(i+5 <=T.length() && (T.substring(i, i+5).equals("maerd") ||T.substring(i, i+5).equals("esare"))){
				//System.out.println(T.substring(i, i+5));
				i +=4;

			}
			else if(i+6<=T.length() && T.substring(i, i+6).equals("resare")){
				//System.out.println(T.substring(i, i+6));
				i += 5;

			}
			else if(i+7<=T.length() && T.substring(i, i+7).equals("remaerd")){
				//System.out.println(T.substring(i, i+7));
				i += 6;

			}

			else{
				flag = false;
				break;
			}
		} int i = 0 ; int i = 0 ; i 0 i < T.length() i T.length() T.length T i++ i++ i {
			if(i+5 <=T.length() && (T.substring(i, i+5).equals("maerd") ||T.substring(i, i+5).equals("esare"))){
				//System.out.println(T.substring(i, i+5));
				i +=4;

			}
			else if(i+6<=T.length() && T.substring(i, i+6).equals("resare")){
				//System.out.println(T.substring(i, i+6));
				i += 5;

			}
			else if(i+7<=T.length() && T.substring(i, i+7).equals("remaerd")){
				//System.out.println(T.substring(i, i+7));
				i += 6;

			}

			else{
				flag = false;
				break;
			}
		} {
			if(i+5 <=T.length() && (T.substring(i, i+5).equals("maerd") ||T.substring(i, i+5).equals("esare"))){
				//System.out.println(T.substring(i, i+5));
				i +=4;

			}
			else if(i+6<=T.length() && T.substring(i, i+6).equals("resare")){
				//System.out.println(T.substring(i, i+6));
				i += 5;

			}
			else if(i+7<=T.length() && T.substring(i, i+7).equals("remaerd")){
				//System.out.println(T.substring(i, i+7));
				i += 6;

			}

			else{
				flag = false;
				break;
			}
		} if(i+5 <=T.length() && (T.substring(i, i+5).equals("maerd") ||T.substring(i, i+5).equals("esare"))){
				//System.out.println(T.substring(i, i+5));
				i +=4;

			}
			else if(i+6<=T.length() && T.substring(i, i+6).equals("resare")){
				//System.out.println(T.substring(i, i+6));
				i += 5;

			}
			else if(i+7<=T.length() && T.substring(i, i+7).equals("remaerd")){
				//System.out.println(T.substring(i, i+7));
				i += 6;

			}

			else{
				flag = false;
				break;
			} i+5 <=T.length() && (T.substring(i, i+5).equals("maerd") ||T.substring(i, i+5).equals("esare")) i+5 <=T.length() i+5 i 5 T.length() T.length T (T.substring(i, i+5).equals("maerd") ||T.substring(i, i+5).equals("esare")) T.substring(i, i+5).equals("maerd") T.substring(i, i+5).equals T.substring(i, i+5) T.substring T i i+5 i 5 "maerd" T.substring(i, i+5).equals("esare") T.substring(i, i+5).equals T.substring(i, i+5) T.substring T i i+5 i 5 "esare" {
				//System.out.println(T.substring(i, i+5));
				i +=4;

			} i +=4 i 4 if(i+6<=T.length() && T.substring(i, i+6).equals("resare")){
				//System.out.println(T.substring(i, i+6));
				i += 5;

			}
			else if(i+7<=T.length() && T.substring(i, i+7).equals("remaerd")){
				//System.out.println(T.substring(i, i+7));
				i += 6;

			}

			else{
				flag = false;
				break;
			} i+6<=T.length() && T.substring(i, i+6).equals("resare") i+6<=T.length() i+6 i 6 T.length() T.length T T.substring(i, i+6).equals("resare") T.substring(i, i+6).equals T.substring(i, i+6) T.substring T i i+6 i 6 "resare" {
				//System.out.println(T.substring(i, i+6));
				i += 5;

			} i += 5 i 5 if(i+7<=T.length() && T.substring(i, i+7).equals("remaerd")){
				//System.out.println(T.substring(i, i+7));
				i += 6;

			}

			else{
				flag = false;
				break;
			} i+7<=T.length() && T.substring(i, i+7).equals("remaerd") i+7<=T.length() i+7 i 7 T.length() T.length T T.substring(i, i+7).equals("remaerd") T.substring(i, i+7).equals T.substring(i, i+7) T.substring T i i+7 i 7 "remaerd" {
				//System.out.println(T.substring(i, i+7));
				i += 6;

			} i += 6 i 6 {
				flag = false;
				break;
			} flag = false flag false break; if(flag){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		} flag {
			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) {
		Scanner sc = new Scanner(System.in);
			String S = sc.next();
		sc.close();


		StringBuffer sb = new StringBuffer(S);
		String T = sb.reverse().toString();

		//System.out.println(T);

		boolean flag = true;
		for(int i = 0 ; i < T.length() ; i++){
			if(i+5 <=T.length() && (T.substring(i, i+5).equals("maerd") ||T.substring(i, i+5).equals("esare"))){
				//System.out.println(T.substring(i, i+5));
				i +=4;

			}
			else if(i+6<=T.length() && T.substring(i, i+6).equals("resare")){
				//System.out.println(T.substring(i, i+6));
				i += 5;

			}
			else if(i+7<=T.length() && T.substring(i, i+7).equals("remaerd")){
				//System.out.println(T.substring(i, i+7));
				i += 6;

			}

			else{
				flag = false;
				break;
			}
		}

		if(flag){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		}
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
			String S = sc.next();
		sc.close();


		StringBuffer sb = new StringBuffer(S);
		String T = sb.reverse().toString();

		//System.out.println(T);

		boolean flag = true;
		for(int i = 0 ; i < T.length() ; i++){
			if(i+5 <=T.length() && (T.substring(i, i+5).equals("maerd") ||T.substring(i, i+5).equals("esare"))){
				//System.out.println(T.substring(i, i+5));
				i +=4;

			}
			else if(i+6<=T.length() && T.substring(i, i+6).equals("resare")){
				//System.out.println(T.substring(i, i+6));
				i += 5;

			}
			else if(i+7<=T.length() && T.substring(i, i+7).equals("remaerd")){
				//System.out.println(T.substring(i, i+7));
				i += 6;

			}

			else{
				flag = false;
				break;
			}
		}

		if(flag){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
			String S = sc.next();
		sc.close();


		StringBuffer sb = new StringBuffer(S);
		String T = sb.reverse().toString();

		//System.out.println(T);

		boolean flag = true;
		for(int i = 0 ; i < T.length() ; i++){
			if(i+5 <=T.length() && (T.substring(i, i+5).equals("maerd") ||T.substring(i, i+5).equals("esare"))){
				//System.out.println(T.substring(i, i+5));
				i +=4;

			}
			else if(i+6<=T.length() && T.substring(i, i+6).equals("resare")){
				//System.out.println(T.substring(i, i+6));
				i += 5;

			}
			else if(i+7<=T.length() && T.substring(i, i+7).equals("remaerd")){
				//System.out.println(T.substring(i, i+7));
				i += 6;

			}

			else{
				flag = false;
				break;
			}
		}

		if(flag){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		}
	}
}