import java.util.*;
import static java.lang.Math.*;

public class Main {

	// 定数
	static final String a  = "dream";
	static final String b  = "dreamer";
	static final String c  = "erase";
	static final String d  = "eraser";

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

		// 入力
		String s = sc.next();// 文字列

		// チェック
		String result = "";

		if(check(s)){
			result = "YES";
		}else{
			result = "NO";
		}

		// 出力
		System.out.println(result);
	}

	static boolean check(String s){
		return s.matches("(dream|dreamer|erase|eraser)+");
	}

}

 import java.util.*; util.* java import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; public class Main {

	// 定数
	static final String a  = "dream";
	static final String b  = "dreamer";
	static final String c  = "erase";
	static final String d  = "eraser";

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

		// 入力
		String s = sc.next();// 文字列

		// チェック
		String result = "";

		if(check(s)){
			result = "YES";
		}else{
			result = "NO";
		}

		// 出力
		System.out.println(result);
	}

	static boolean check(String s){
		return s.matches("(dream|dreamer|erase|eraser)+");
	}

} Main // 定数
	static final String a  = "dream"; a "dream" static final String b  = "dreamer"; b "dreamer" static final String c  = "erase"; c "erase" static final String d  = "eraser"; d "eraser" public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		// 入力
		String s = sc.next();// 文字列

		// チェック
		String result = "";

		if(check(s)){
			result = "YES";
		}else{
			result = "NO";
		}

		// 出力
		System.out.println(result);
	} main {
		Scanner sc = new Scanner(System.in);

		// 入力
		String s = sc.next();// 文字列

		// チェック
		String result = "";

		if(check(s)){
			result = "YES";
		}else{
			result = "NO";
		}

		// 出力
		System.out.println(result);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String result = ""; result "" if(check(s)){
			result = "YES";
		}else{
			result = "NO";
		} check(s) check s {
			result = "YES";
		} result = "YES" result "YES" {
			result = "NO";
		} result = "NO" result "NO" System.out.println(result) System.out.println System.out System System.out result String[] args args static boolean check(String s){
		return s.matches("(dream|dreamer|erase|eraser)+");
	} check {
		return s.matches("(dream|dreamer|erase|eraser)+");
	} return s.matches("(dream|dreamer|erase|eraser)+"); s.matches("(dream|dreamer|erase|eraser)+") s.matches s "(dream|dreamer|erase|eraser)+" String s s public class Main {

	// 定数
	static final String a  = "dream";
	static final String b  = "dreamer";
	static final String c  = "erase";
	static final String d  = "eraser";

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

		// 入力
		String s = sc.next();// 文字列

		// チェック
		String result = "";

		if(check(s)){
			result = "YES";
		}else{
			result = "NO";
		}

		// 出力
		System.out.println(result);
	}

	static boolean check(String s){
		return s.matches("(dream|dreamer|erase|eraser)+");
	}

} public class Main {

	// 定数
	static final String a  = "dream";
	static final String b  = "dreamer";
	static final String c  = "erase";
	static final String d  = "eraser";

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

		// 入力
		String s = sc.next();// 文字列

		// チェック
		String result = "";

		if(check(s)){
			result = "YES";
		}else{
			result = "NO";
		}

		// 出力
		System.out.println(result);
	}

	static boolean check(String s){
		return s.matches("(dream|dreamer|erase|eraser)+");
	}

} Main
import java.util.*;
import static java.lang.Math.*;

public class Main {

	// 定数
	static final String a  = "dream";
	static final String b  = "dreamer";
	static final String c  = "erase";
	static final String d  = "eraser";

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

		// 入力
		String s = sc.next();// 文字列

		// チェック
		String result = "";

		if(check(s)){
			result = "YES";
		}else{
			result = "NO";
		}

		// 出力
		System.out.println(result);
	}

	static boolean check(String s){
		return s.matches("(dream|dreamer|erase|eraser)+");
	}

}


