import java.util.*;

public class Main{
	public static void main(String args[]){
		
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int a=0;
		int length;
		
	
	
	    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","");
		}
		
		if(s.equals("")){
			System.out.println("YES");
		}
		
		else{
				System.out.println("NO");
		}
			
		
		
		
		
	
	}
} import java.util.*; util.* java public class Main{
	public static void main(String args[]){
		
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int a=0;
		int length;
		
	
	
	    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","");
		}
		
		if(s.equals("")){
			System.out.println("YES");
		}
		
		else{
				System.out.println("NO");
		}
			
		
		
		
		
	
	}
} Main public static void main(String args[]){
		
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int a=0;
		int length;
		
	
	
	    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","");
		}
		
		if(s.equals("")){
			System.out.println("YES");
		}
		
		else{
				System.out.println("NO");
		}
			
		
		
		
		
	
	} main {
		
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int a=0;
		int length;
		
	
	
	    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","");
		}
		
		if(s.equals("")){
			System.out.println("YES");
		}
		
		else{
				System.out.println("NO");
		}
			
		
		
		
		
	
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int a=0; a 0 int length; length 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" "" if(s.equals("")){
			System.out.println("YES");
		}
		
		else{
				System.out.println("NO");
		} s.equals("") s.equals s "" {
			System.out.println("YES");
		} System.out.println("YES") System.out.println System.out System System.out "YES" {
				System.out.println("NO");
		} System.out.println("NO") System.out.println System.out System System.out "NO" String args[] args public class Main{
	public static void main(String args[]){
		
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int a=0;
		int length;
		
	
	
	    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","");
		}
		
		if(s.equals("")){
			System.out.println("YES");
		}
		
		else{
				System.out.println("NO");
		}
			
		
		
		
		
	
	}
} public class Main{
	public static void main(String args[]){
		
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int a=0;
		int length;
		
	
	
	    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","");
		}
		
		if(s.equals("")){
			System.out.println("YES");
		}
		
		else{
				System.out.println("NO");
		}
			
		
		
		
		
	
	}
} Main
import java.util.*;

public class Main{
	public static void main(String args[]){
		
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int a=0;
		int length;
		
	
	
	    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","");
		}
		
		if(s.equals("")){
			System.out.println("YES");
		}
		
		else{
				System.out.println("NO");
		}
			
		
		
		
		
	
	}
}