import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		System.out.println(sc.next()
				.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", "")
				.equals("") ? "YES" :"NO");
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		System.out.println(sc.next()
				.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", "")
				.equals("") ? "YES" :"NO");
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		System.out.println(sc.next()
				.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", "")
				.equals("") ? "YES" :"NO");
	} main {
		Scanner sc = new Scanner(System.in);
		System.out.println(sc.next()
				.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", "")
				.equals("") ? "YES" :"NO");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) System.out.println(sc.next()
				.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", "")
				.equals("") ? "YES" :"NO") System.out.println System.out System System.out sc.next()
				.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", "")
				.equals("") ? "YES" :"NO" sc.next()
				.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", "")
				.equals("") sc.next()
				.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", "")
				.equals sc.next()
				.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", "") sc.next()
				.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace sc.next()
				.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "") sc.next()
				.replace("eraser", "")
				.replace("erase", "")
				.replace sc.next()
				.replace("eraser", "")
				.replace("erase", "") sc.next()
				.replace("eraser", "")
				.replace sc.next()
				.replace("eraser", "") sc.next()
				.replace sc.next() sc.next sc "eraser" "" "erase" "" "dreamer" "" "dream" "" "" "YES" "NO" String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		System.out.println(sc.next()
				.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", "")
				.equals("") ? "YES" :"NO");
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		System.out.println(sc.next()
				.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", "")
				.equals("") ? "YES" :"NO");
	}
} Main
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		System.out.println(sc.next()
				.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", "")
				.equals("") ? "YES" :"NO");
	}
}