import java.util.*;
// warm-up
// Will this ordering work? 
public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		StringBuilder s = new StringBuilder(sc.next().replaceAll("eraser","")
			.replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream",""));
		System.out.println(s.length()==0 ? "YES" : "NO");
		sc.close();			
	}

	public static void main(String args[]) {
		solve();
	}

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

	static void solve() {
		Scanner sc = new Scanner(System.in);
		StringBuilder s = new StringBuilder(sc.next().replaceAll("eraser","")
			.replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream",""));
		System.out.println(s.length()==0 ? "YES" : "NO");
		sc.close();			
	}

	public static void main(String args[]) {
		solve();
	}

} Main static void solve() {
		Scanner sc = new Scanner(System.in);
		StringBuilder s = new StringBuilder(sc.next().replaceAll("eraser","")
			.replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream",""));
		System.out.println(s.length()==0 ? "YES" : "NO");
		sc.close();			
	} solve {
		Scanner sc = new Scanner(System.in);
		StringBuilder s = new StringBuilder(sc.next().replaceAll("eraser","")
			.replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream",""));
		System.out.println(s.length()==0 ? "YES" : "NO");
		sc.close();			
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder s = new StringBuilder(sc.next().replaceAll("eraser","")
			.replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","")); s new StringBuilder(sc.next().replaceAll("eraser","")
			.replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","")) System.out.println(s.length()==0 ? "YES" : "NO") System.out.println System.out System System.out s.length()==0 ? "YES" : "NO" s.length()==0 s.length() s.length s 0 "YES" "NO" sc.close() sc.close sc public static void main(String args[]) {
		solve();
	} main {
		solve();
	} solve() solve String args[] args public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		StringBuilder s = new StringBuilder(sc.next().replaceAll("eraser","")
			.replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream",""));
		System.out.println(s.length()==0 ? "YES" : "NO");
		sc.close();			
	}

	public static void main(String args[]) {
		solve();
	}

} public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		StringBuilder s = new StringBuilder(sc.next().replaceAll("eraser","")
			.replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream",""));
		System.out.println(s.length()==0 ? "YES" : "NO");
		sc.close();			
	}

	public static void main(String args[]) {
		solve();
	}

} Main
import java.util.*;
// warm-up
// Will this ordering work? 
public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		StringBuilder s = new StringBuilder(sc.next().replaceAll("eraser","")
			.replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream",""));
		System.out.println(s.length()==0 ? "YES" : "NO");
		sc.close();			
	}

	public static void main(String args[]) {
		solve();
	}

}