import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        
        s = s.replaceAll("eraser","_");
        s = s.replaceAll("erase","_");
        s = s.replaceAll("dreamer","_");
        s = s.replaceAll("dream","_");
        s = s.replaceAll("_","");
        
        if(s.length() == 0){
            System.out.println("YES");
        }else{
            
            System.out.println("NO");
        }
            
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        
        s = s.replaceAll("eraser","_");
        s = s.replaceAll("erase","_");
        s = s.replaceAll("dreamer","_");
        s = s.replaceAll("dream","_");
        s = s.replaceAll("_","");
        
        if(s.length() == 0){
            System.out.println("YES");
        }else{
            
            System.out.println("NO");
        }
            
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        
        s = s.replaceAll("eraser","_");
        s = s.replaceAll("erase","_");
        s = s.replaceAll("dreamer","_");
        s = s.replaceAll("dream","_");
        s = s.replaceAll("_","");
        
        if(s.length() == 0){
            System.out.println("YES");
        }else{
            
            System.out.println("NO");
        }
            
    } main {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        
        s = s.replaceAll("eraser","_");
        s = s.replaceAll("erase","_");
        s = s.replaceAll("dreamer","_");
        s = s.replaceAll("dream","_");
        s = s.replaceAll("_","");
        
        if(s.length() == 0){
            System.out.println("YES");
        }else{
            
            System.out.println("NO");
        }
            
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String s = br.readLine(); s br.readLine() br.readLine br s = s.replaceAll("eraser","_") s s.replaceAll("eraser","_") s.replaceAll s "eraser" "_" s = s.replaceAll("erase","_") s s.replaceAll("erase","_") s.replaceAll s "erase" "_" s = s.replaceAll("dreamer","_") s s.replaceAll("dreamer","_") s.replaceAll s "dreamer" "_" s = s.replaceAll("dream","_") s s.replaceAll("dream","_") s.replaceAll s "dream" "_" s = s.replaceAll("_","") s s.replaceAll("_","") s.replaceAll s "_" "" if(s.length() == 0){
            System.out.println("YES");
        }else{
            
            System.out.println("NO");
        } s.length() == 0 s.length() s.length s 0 {
            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) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        
        s = s.replaceAll("eraser","_");
        s = s.replaceAll("erase","_");
        s = s.replaceAll("dreamer","_");
        s = s.replaceAll("dream","_");
        s = s.replaceAll("_","");
        
        if(s.length() == 0){
            System.out.println("YES");
        }else{
            
            System.out.println("NO");
        }
            
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        
        s = s.replaceAll("eraser","_");
        s = s.replaceAll("erase","_");
        s = s.replaceAll("dreamer","_");
        s = s.replaceAll("dream","_");
        s = s.replaceAll("_","");
        
        if(s.length() == 0){
            System.out.println("YES");
        }else{
            
            System.out.println("NO");
        }
            
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        
        s = s.replaceAll("eraser","_");
        s = s.replaceAll("erase","_");
        s = s.replaceAll("dreamer","_");
        s = s.replaceAll("dream","_");
        s = s.replaceAll("_","");
        
        if(s.length() == 0){
            System.out.println("YES");
        }else{
            
            System.out.println("NO");
        }
            
    }
}
