    import java.util.Scanner;
     
    class Main{
     
        public static void main(String[] args){
            Scanner sc = new Scanner(System.in);
            String S = sc.nextLine();
            String T = "";
            String[] str = {"dream","dreamer","erase","eraser"};
     
            
            S = S.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "");
     
            if( S.equals("")){
                System.out.println("YES"); 
            }else{
                System.out.println("NO");
            }
            
        }
    } import java.util.Scanner; Scanner java.util class Main{
     
        public static void main(String[] args){
            Scanner sc = new Scanner(System.in);
            String S = sc.nextLine();
            String T = "";
            String[] str = {"dream","dreamer","erase","eraser"};
     
            
            S = S.replace("eraser", "").replace("erase", "").replace("dreamer", "").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.nextLine();
            String T = "";
            String[] str = {"dream","dreamer","erase","eraser"};
     
            
            S = S.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "");
     
            if( S.equals("")){
                System.out.println("YES"); 
            }else{
                System.out.println("NO");
            }
            
        } main {
            Scanner sc = new Scanner(System.in);
            String S = sc.nextLine();
            String T = "";
            String[] str = {"dream","dreamer","erase","eraser"};
     
            
            S = S.replace("eraser", "").replace("erase", "").replace("dreamer", "").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.nextLine(); S sc.nextLine() sc.nextLine sc String T = ""; T "" String[] str = {"dream","dreamer","erase","eraser"}; str {"dream","dreamer","erase","eraser"} "dream" "dreamer" "erase" "eraser" S = S.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "") S S.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "") S.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace S.replace("eraser", "").replace("erase", "").replace("dreamer", "") S.replace("eraser", "").replace("erase", "").replace S.replace("eraser", "").replace("erase", "") S.replace("eraser", "").replace S.replace("eraser", "") S.replace S "eraser" "" "erase" "" "dreamer" "" "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
    import java.util.Scanner;
     
    class Main{
     
        public static void main(String[] args){
            Scanner sc = new Scanner(System.in);
            String S = sc.nextLine();
            String T = "";
            String[] str = {"dream","dreamer","erase","eraser"};
     
            
            S = S.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "");
     
            if( S.equals("")){
                System.out.println("YES"); 
            }else{
                System.out.println("NO");
            }
            
        }
    }