import java.util.Scanner;
public class Main{
	public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
	String s=sc.next();

	if(s.contains("eraser")) {
		s=s.replace("eraser", "");
	}
	if(s.contains("erase")) {
		s=s.replace("erase", "");
	}
	if(s.contains("dreamer")) {
		s=s.replace("dreamer", "");
	}
	if(s.contains("dream")) {
		s=s.replace("dream", "");
	}
	
	System.out.println(s.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);
	String s=sc.next();

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

	if(s.contains("eraser")) {
		s=s.replace("eraser", "");
	}
	if(s.contains("erase")) {
		s=s.replace("erase", "");
	}
	if(s.contains("dreamer")) {
		s=s.replace("dreamer", "");
	}
	if(s.contains("dream")) {
		s=s.replace("dream", "");
	}
	
	System.out.println(s.equals("")?"YES":"NO");
	} main {
	Scanner sc=new Scanner(System.in);
	String s=sc.next();

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

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

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

	if(s.contains("eraser")) {
		s=s.replace("eraser", "");
	}
	if(s.contains("erase")) {
		s=s.replace("erase", "");
	}
	if(s.contains("dreamer")) {
		s=s.replace("dreamer", "");
	}
	if(s.contains("dream")) {
		s=s.replace("dream", "");
	}
	
	System.out.println(s.equals("")?"YES":"NO");
	}
}