import java.util.*;

public class Main {
	public static void main(String[] args)  {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String ans ;
		String A = S.replace("eraser","");
		String B = A.replace("erase","");
		String C = B.replace("dreamer","");
		String D = C.replace("dream","");
		if(D.length() == 0){
			ans = "YES";
		}else{
			ans = "NO";
		}
			System.out.println(ans);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args)  {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String ans ;
		String A = S.replace("eraser","");
		String B = A.replace("erase","");
		String C = B.replace("dreamer","");
		String D = C.replace("dream","");
		if(D.length() == 0){
			ans = "YES";
		}else{
			ans = "NO";
		}
			System.out.println(ans);
	}
} Main public static void main(String[] args)  {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String ans ;
		String A = S.replace("eraser","");
		String B = A.replace("erase","");
		String C = B.replace("dreamer","");
		String D = C.replace("dream","");
		if(D.length() == 0){
			ans = "YES";
		}else{
			ans = "NO";
		}
			System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String ans ;
		String A = S.replace("eraser","");
		String B = A.replace("erase","");
		String C = B.replace("dreamer","");
		String D = C.replace("dream","");
		if(D.length() == 0){
			ans = "YES";
		}else{
			ans = "NO";
		}
			System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc String ans ; ans String A = S.replace("eraser",""); A S.replace("eraser","") S.replace S "eraser" "" String B = A.replace("erase",""); B A.replace("erase","") A.replace A "erase" "" String C = B.replace("dreamer",""); C B.replace("dreamer","") B.replace B "dreamer" "" String D = C.replace("dream",""); D C.replace("dream","") C.replace C "dream" "" if(D.length() == 0){
			ans = "YES";
		}else{
			ans = "NO";
		} D.length() == 0 D.length() D.length D 0 {
			ans = "YES";
		} ans = "YES" ans "YES" {
			ans = "NO";
		} ans = "NO" ans "NO" System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args)  {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String ans ;
		String A = S.replace("eraser","");
		String B = A.replace("erase","");
		String C = B.replace("dreamer","");
		String D = C.replace("dream","");
		if(D.length() == 0){
			ans = "YES";
		}else{
			ans = "NO";
		}
			System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args)  {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String ans ;
		String A = S.replace("eraser","");
		String B = A.replace("erase","");
		String C = B.replace("dreamer","");
		String D = C.replace("dream","");
		if(D.length() == 0){
			ans = "YES";
		}else{
			ans = "NO";
		}
			System.out.println(ans);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args)  {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String ans ;
		String A = S.replace("eraser","");
		String B = A.replace("erase","");
		String C = B.replace("dreamer","");
		String D = C.replace("dream","");
		if(D.length() == 0){
			ans = "YES";
		}else{
			ans = "NO";
		}
			System.out.println(ans);
	}
}
