import java.util.Scanner;

class Main{




	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		String S = sc.next();
		StringBuilder sb = new StringBuilder(S);
		while(true){

			if(sb.length() == 0){					//文字数が0で完了
				System.out.println("YES");
				return;
			}

			if(sb.length() < 5){					//文字数が5以下はありえない
				System.out.println("NO");
				return;
			}

			if(sb.length() >= 7){
				if(sb.substring(sb.length()-7,sb.length()).equals("dreamer")){
				//	System.out.println("dreamer");
					sb.delete(sb.length()-7,sb.length());
					continue;

				}
			}
			if(sb.length() >= 6){
				if(sb.substring(sb.length()-6,sb.length()).equals("eraser")){
				//	System.out.println("eraser");
					sb.delete(sb.length()-6,sb.length());
					continue;
				}
			}
			if(sb.length() >= 5){
				if(sb.substring(sb.length()-5,sb.length()).equals("dream")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				}else if(sb.substring(sb.length()-5,sb.length()).equals("erase")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				}
			}

			System.out.println("NO");
			return;


		}

	}
}

class Pair implements Comparable{
	int from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	}
}

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




	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		String S = sc.next();
		StringBuilder sb = new StringBuilder(S);
		while(true){

			if(sb.length() == 0){					//文字数が0で完了
				System.out.println("YES");
				return;
			}

			if(sb.length() < 5){					//文字数が5以下はありえない
				System.out.println("NO");
				return;
			}

			if(sb.length() >= 7){
				if(sb.substring(sb.length()-7,sb.length()).equals("dreamer")){
				//	System.out.println("dreamer");
					sb.delete(sb.length()-7,sb.length());
					continue;

				}
			}
			if(sb.length() >= 6){
				if(sb.substring(sb.length()-6,sb.length()).equals("eraser")){
				//	System.out.println("eraser");
					sb.delete(sb.length()-6,sb.length());
					continue;
				}
			}
			if(sb.length() >= 5){
				if(sb.substring(sb.length()-5,sb.length()).equals("dream")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				}else if(sb.substring(sb.length()-5,sb.length()).equals("erase")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				}
			}

			System.out.println("NO");
			return;


		}

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		String S = sc.next();
		StringBuilder sb = new StringBuilder(S);
		while(true){

			if(sb.length() == 0){					//文字数が0で完了
				System.out.println("YES");
				return;
			}

			if(sb.length() < 5){					//文字数が5以下はありえない
				System.out.println("NO");
				return;
			}

			if(sb.length() >= 7){
				if(sb.substring(sb.length()-7,sb.length()).equals("dreamer")){
				//	System.out.println("dreamer");
					sb.delete(sb.length()-7,sb.length());
					continue;

				}
			}
			if(sb.length() >= 6){
				if(sb.substring(sb.length()-6,sb.length()).equals("eraser")){
				//	System.out.println("eraser");
					sb.delete(sb.length()-6,sb.length());
					continue;
				}
			}
			if(sb.length() >= 5){
				if(sb.substring(sb.length()-5,sb.length()).equals("dream")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				}else if(sb.substring(sb.length()-5,sb.length()).equals("erase")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				}
			}

			System.out.println("NO");
			return;


		}

	} main {
		Scanner sc = new Scanner(System.in);			//文字の入力
		String S = sc.next();
		StringBuilder sb = new StringBuilder(S);
		while(true){

			if(sb.length() == 0){					//文字数が0で完了
				System.out.println("YES");
				return;
			}

			if(sb.length() < 5){					//文字数が5以下はありえない
				System.out.println("NO");
				return;
			}

			if(sb.length() >= 7){
				if(sb.substring(sb.length()-7,sb.length()).equals("dreamer")){
				//	System.out.println("dreamer");
					sb.delete(sb.length()-7,sb.length());
					continue;

				}
			}
			if(sb.length() >= 6){
				if(sb.substring(sb.length()-6,sb.length()).equals("eraser")){
				//	System.out.println("eraser");
					sb.delete(sb.length()-6,sb.length());
					continue;
				}
			}
			if(sb.length() >= 5){
				if(sb.substring(sb.length()-5,sb.length()).equals("dream")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				}else if(sb.substring(sb.length()-5,sb.length()).equals("erase")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				}
			}

			System.out.println("NO");
			return;


		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc StringBuilder sb = new StringBuilder(S); sb new StringBuilder(S) while(true){

			if(sb.length() == 0){					//文字数が0で完了
				System.out.println("YES");
				return;
			}

			if(sb.length() < 5){					//文字数が5以下はありえない
				System.out.println("NO");
				return;
			}

			if(sb.length() >= 7){
				if(sb.substring(sb.length()-7,sb.length()).equals("dreamer")){
				//	System.out.println("dreamer");
					sb.delete(sb.length()-7,sb.length());
					continue;

				}
			}
			if(sb.length() >= 6){
				if(sb.substring(sb.length()-6,sb.length()).equals("eraser")){
				//	System.out.println("eraser");
					sb.delete(sb.length()-6,sb.length());
					continue;
				}
			}
			if(sb.length() >= 5){
				if(sb.substring(sb.length()-5,sb.length()).equals("dream")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				}else if(sb.substring(sb.length()-5,sb.length()).equals("erase")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				}
			}

			System.out.println("NO");
			return;


		} true {

			if(sb.length() == 0){					//文字数が0で完了
				System.out.println("YES");
				return;
			}

			if(sb.length() < 5){					//文字数が5以下はありえない
				System.out.println("NO");
				return;
			}

			if(sb.length() >= 7){
				if(sb.substring(sb.length()-7,sb.length()).equals("dreamer")){
				//	System.out.println("dreamer");
					sb.delete(sb.length()-7,sb.length());
					continue;

				}
			}
			if(sb.length() >= 6){
				if(sb.substring(sb.length()-6,sb.length()).equals("eraser")){
				//	System.out.println("eraser");
					sb.delete(sb.length()-6,sb.length());
					continue;
				}
			}
			if(sb.length() >= 5){
				if(sb.substring(sb.length()-5,sb.length()).equals("dream")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				}else if(sb.substring(sb.length()-5,sb.length()).equals("erase")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				}
			}

			System.out.println("NO");
			return;


		} if(sb.length() == 0){					//文字数が0で完了
				System.out.println("YES");
				return;
			} sb.length() == 0 sb.length() sb.length sb 0 {					//文字数が0で完了
				System.out.println("YES");
				return;
			} System.out.println("YES") System.out.println System.out System System.out "YES" return; if(sb.length() < 5){					//文字数が5以下はありえない
				System.out.println("NO");
				return;
			} sb.length() < 5 sb.length() sb.length sb 5 {					//文字数が5以下はありえない
				System.out.println("NO");
				return;
			} System.out.println("NO") System.out.println System.out System System.out "NO" return; if(sb.length() >= 7){
				if(sb.substring(sb.length()-7,sb.length()).equals("dreamer")){
				//	System.out.println("dreamer");
					sb.delete(sb.length()-7,sb.length());
					continue;

				}
			} sb.length() >= 7 sb.length() sb.length sb 7 {
				if(sb.substring(sb.length()-7,sb.length()).equals("dreamer")){
				//	System.out.println("dreamer");
					sb.delete(sb.length()-7,sb.length());
					continue;

				}
			} if(sb.substring(sb.length()-7,sb.length()).equals("dreamer")){
				//	System.out.println("dreamer");
					sb.delete(sb.length()-7,sb.length());
					continue;

				} sb.substring(sb.length()-7,sb.length()).equals("dreamer") sb.substring(sb.length()-7,sb.length()).equals sb.substring(sb.length()-7,sb.length()) sb.substring sb sb.length()-7 sb.length() sb.length sb 7 sb.length() sb.length sb "dreamer" {
				//	System.out.println("dreamer");
					sb.delete(sb.length()-7,sb.length());
					continue;

				} sb.delete(sb.length()-7,sb.length()) sb.delete sb sb.length()-7 sb.length() sb.length sb 7 sb.length() sb.length sb continue; if(sb.length() >= 6){
				if(sb.substring(sb.length()-6,sb.length()).equals("eraser")){
				//	System.out.println("eraser");
					sb.delete(sb.length()-6,sb.length());
					continue;
				}
			} sb.length() >= 6 sb.length() sb.length sb 6 {
				if(sb.substring(sb.length()-6,sb.length()).equals("eraser")){
				//	System.out.println("eraser");
					sb.delete(sb.length()-6,sb.length());
					continue;
				}
			} if(sb.substring(sb.length()-6,sb.length()).equals("eraser")){
				//	System.out.println("eraser");
					sb.delete(sb.length()-6,sb.length());
					continue;
				} sb.substring(sb.length()-6,sb.length()).equals("eraser") sb.substring(sb.length()-6,sb.length()).equals sb.substring(sb.length()-6,sb.length()) sb.substring sb sb.length()-6 sb.length() sb.length sb 6 sb.length() sb.length sb "eraser" {
				//	System.out.println("eraser");
					sb.delete(sb.length()-6,sb.length());
					continue;
				} sb.delete(sb.length()-6,sb.length()) sb.delete sb sb.length()-6 sb.length() sb.length sb 6 sb.length() sb.length sb continue; if(sb.length() >= 5){
				if(sb.substring(sb.length()-5,sb.length()).equals("dream")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				}else if(sb.substring(sb.length()-5,sb.length()).equals("erase")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				}
			} sb.length() >= 5 sb.length() sb.length sb 5 {
				if(sb.substring(sb.length()-5,sb.length()).equals("dream")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				}else if(sb.substring(sb.length()-5,sb.length()).equals("erase")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				}
			} if(sb.substring(sb.length()-5,sb.length()).equals("dream")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				}else if(sb.substring(sb.length()-5,sb.length()).equals("erase")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				} sb.substring(sb.length()-5,sb.length()).equals("dream") sb.substring(sb.length()-5,sb.length()).equals sb.substring(sb.length()-5,sb.length()) sb.substring sb sb.length()-5 sb.length() sb.length sb 5 sb.length() sb.length sb "dream" {
					sb.delete(sb.length()-5,sb.length());
					continue;
				} sb.delete(sb.length()-5,sb.length()) sb.delete sb sb.length()-5 sb.length() sb.length sb 5 sb.length() sb.length sb continue; if(sb.substring(sb.length()-5,sb.length()).equals("erase")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				} sb.substring(sb.length()-5,sb.length()).equals("erase") sb.substring(sb.length()-5,sb.length()).equals sb.substring(sb.length()-5,sb.length()) sb.substring sb sb.length()-5 sb.length() sb.length sb 5 sb.length() sb.length sb "erase" {
					sb.delete(sb.length()-5,sb.length());
					continue;
				} sb.delete(sb.length()-5,sb.length()) sb.delete sb sb.length()-5 sb.length() sb.length sb 5 sb.length() sb.length sb continue; System.out.println("NO") System.out.println System.out System System.out "NO" return; String[] args args class Pair implements Comparable{
	int from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	}
} Pair int from; from int end; end @Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	} compareTo {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	} Pair otherpair = (Pair)other; otherpair (Pair)other return end - otherpair.end; end - otherpair.end end otherpair.end otherpair otherpair.end Object other other Comparable
import java.util.Scanner;

class Main{




	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		String S = sc.next();
		StringBuilder sb = new StringBuilder(S);
		while(true){

			if(sb.length() == 0){					//文字数が0で完了
				System.out.println("YES");
				return;
			}

			if(sb.length() < 5){					//文字数が5以下はありえない
				System.out.println("NO");
				return;
			}

			if(sb.length() >= 7){
				if(sb.substring(sb.length()-7,sb.length()).equals("dreamer")){
				//	System.out.println("dreamer");
					sb.delete(sb.length()-7,sb.length());
					continue;

				}
			}
			if(sb.length() >= 6){
				if(sb.substring(sb.length()-6,sb.length()).equals("eraser")){
				//	System.out.println("eraser");
					sb.delete(sb.length()-6,sb.length());
					continue;
				}
			}
			if(sb.length() >= 5){
				if(sb.substring(sb.length()-5,sb.length()).equals("dream")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				}else if(sb.substring(sb.length()-5,sb.length()).equals("erase")){
					sb.delete(sb.length()-5,sb.length());
					continue;
				}
			}

			System.out.println("NO");
			return;


		}

	}
}

class Pair implements Comparable{
	int from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	}
}


