import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String res = "NO";
        int index = 0;
        while (true){
            if (s.length() == index){
                res = "YES";
                break;
            }
            if (s.length() - index < 5){
                break;
            }
            
            if(s.startsWith("dream",index)){
               index += 5; 
               if (s.startsWith("eraser",index)){
                   index += 6;
               }else if (s.startsWith("erase",index)){
                   index += 5;
               }else if (s.startsWith("er",index)){
                   index += 2;
               }
               
            }else if (s.startsWith("erase",index)){
                index += 5;
                if (s.startsWith("eraser",index)){
                    index += 6;
                }else if (s.startsWith("r",index)){
                    index += 1;
                }
            }else{
                break;
            }
        }

        System.out.println(res);
        
    }

} 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();
        String res = "NO";
        int index = 0;
        while (true){
            if (s.length() == index){
                res = "YES";
                break;
            }
            if (s.length() - index < 5){
                break;
            }
            
            if(s.startsWith("dream",index)){
               index += 5; 
               if (s.startsWith("eraser",index)){
                   index += 6;
               }else if (s.startsWith("erase",index)){
                   index += 5;
               }else if (s.startsWith("er",index)){
                   index += 2;
               }
               
            }else if (s.startsWith("erase",index)){
                index += 5;
                if (s.startsWith("eraser",index)){
                    index += 6;
                }else if (s.startsWith("r",index)){
                    index += 1;
                }
            }else{
                break;
            }
        }

        System.out.println(res);
        
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String res = "NO";
        int index = 0;
        while (true){
            if (s.length() == index){
                res = "YES";
                break;
            }
            if (s.length() - index < 5){
                break;
            }
            
            if(s.startsWith("dream",index)){
               index += 5; 
               if (s.startsWith("eraser",index)){
                   index += 6;
               }else if (s.startsWith("erase",index)){
                   index += 5;
               }else if (s.startsWith("er",index)){
                   index += 2;
               }
               
            }else if (s.startsWith("erase",index)){
                index += 5;
                if (s.startsWith("eraser",index)){
                    index += 6;
                }else if (s.startsWith("r",index)){
                    index += 1;
                }
            }else{
                break;
            }
        }

        System.out.println(res);
        
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String res = "NO";
        int index = 0;
        while (true){
            if (s.length() == index){
                res = "YES";
                break;
            }
            if (s.length() - index < 5){
                break;
            }
            
            if(s.startsWith("dream",index)){
               index += 5; 
               if (s.startsWith("eraser",index)){
                   index += 6;
               }else if (s.startsWith("erase",index)){
                   index += 5;
               }else if (s.startsWith("er",index)){
                   index += 2;
               }
               
            }else if (s.startsWith("erase",index)){
                index += 5;
                if (s.startsWith("eraser",index)){
                    index += 6;
                }else if (s.startsWith("r",index)){
                    index += 1;
                }
            }else{
                break;
            }
        }

        System.out.println(res);
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String res = "NO"; res "NO" int index = 0; index 0 while (true){
            if (s.length() == index){
                res = "YES";
                break;
            }
            if (s.length() - index < 5){
                break;
            }
            
            if(s.startsWith("dream",index)){
               index += 5; 
               if (s.startsWith("eraser",index)){
                   index += 6;
               }else if (s.startsWith("erase",index)){
                   index += 5;
               }else if (s.startsWith("er",index)){
                   index += 2;
               }
               
            }else if (s.startsWith("erase",index)){
                index += 5;
                if (s.startsWith("eraser",index)){
                    index += 6;
                }else if (s.startsWith("r",index)){
                    index += 1;
                }
            }else{
                break;
            }
        } true {
            if (s.length() == index){
                res = "YES";
                break;
            }
            if (s.length() - index < 5){
                break;
            }
            
            if(s.startsWith("dream",index)){
               index += 5; 
               if (s.startsWith("eraser",index)){
                   index += 6;
               }else if (s.startsWith("erase",index)){
                   index += 5;
               }else if (s.startsWith("er",index)){
                   index += 2;
               }
               
            }else if (s.startsWith("erase",index)){
                index += 5;
                if (s.startsWith("eraser",index)){
                    index += 6;
                }else if (s.startsWith("r",index)){
                    index += 1;
                }
            }else{
                break;
            }
        } if (s.length() == index){
                res = "YES";
                break;
            } s.length() == index s.length() s.length s index {
                res = "YES";
                break;
            } res = "YES" res "YES" break; if (s.length() - index < 5){
                break;
            } s.length() - index < 5 s.length() - index s.length() s.length s index 5 {
                break;
            } break; if(s.startsWith("dream",index)){
               index += 5; 
               if (s.startsWith("eraser",index)){
                   index += 6;
               }else if (s.startsWith("erase",index)){
                   index += 5;
               }else if (s.startsWith("er",index)){
                   index += 2;
               }
               
            }else if (s.startsWith("erase",index)){
                index += 5;
                if (s.startsWith("eraser",index)){
                    index += 6;
                }else if (s.startsWith("r",index)){
                    index += 1;
                }
            }else{
                break;
            } s.startsWith("dream",index) s.startsWith s "dream" index {
               index += 5; 
               if (s.startsWith("eraser",index)){
                   index += 6;
               }else if (s.startsWith("erase",index)){
                   index += 5;
               }else if (s.startsWith("er",index)){
                   index += 2;
               }
               
            } index += 5 index 5 if (s.startsWith("eraser",index)){
                   index += 6;
               }else if (s.startsWith("erase",index)){
                   index += 5;
               }else if (s.startsWith("er",index)){
                   index += 2;
               } s.startsWith("eraser",index) s.startsWith s "eraser" index {
                   index += 6;
               } index += 6 index 6 if (s.startsWith("erase",index)){
                   index += 5;
               }else if (s.startsWith("er",index)){
                   index += 2;
               } s.startsWith("erase",index) s.startsWith s "erase" index {
                   index += 5;
               } index += 5 index 5 if (s.startsWith("er",index)){
                   index += 2;
               } s.startsWith("er",index) s.startsWith s "er" index {
                   index += 2;
               } index += 2 index 2 if (s.startsWith("erase",index)){
                index += 5;
                if (s.startsWith("eraser",index)){
                    index += 6;
                }else if (s.startsWith("r",index)){
                    index += 1;
                }
            }else{
                break;
            } s.startsWith("erase",index) s.startsWith s "erase" index {
                index += 5;
                if (s.startsWith("eraser",index)){
                    index += 6;
                }else if (s.startsWith("r",index)){
                    index += 1;
                }
            } index += 5 index 5 if (s.startsWith("eraser",index)){
                    index += 6;
                }else if (s.startsWith("r",index)){
                    index += 1;
                } s.startsWith("eraser",index) s.startsWith s "eraser" index {
                    index += 6;
                } index += 6 index 6 if (s.startsWith("r",index)){
                    index += 1;
                } s.startsWith("r",index) s.startsWith s "r" index {
                    index += 1;
                } index += 1 index 1 {
                break;
            } break; System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String res = "NO";
        int index = 0;
        while (true){
            if (s.length() == index){
                res = "YES";
                break;
            }
            if (s.length() - index < 5){
                break;
            }
            
            if(s.startsWith("dream",index)){
               index += 5; 
               if (s.startsWith("eraser",index)){
                   index += 6;
               }else if (s.startsWith("erase",index)){
                   index += 5;
               }else if (s.startsWith("er",index)){
                   index += 2;
               }
               
            }else if (s.startsWith("erase",index)){
                index += 5;
                if (s.startsWith("eraser",index)){
                    index += 6;
                }else if (s.startsWith("r",index)){
                    index += 1;
                }
            }else{
                break;
            }
        }

        System.out.println(res);
        
    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String res = "NO";
        int index = 0;
        while (true){
            if (s.length() == index){
                res = "YES";
                break;
            }
            if (s.length() - index < 5){
                break;
            }
            
            if(s.startsWith("dream",index)){
               index += 5; 
               if (s.startsWith("eraser",index)){
                   index += 6;
               }else if (s.startsWith("erase",index)){
                   index += 5;
               }else if (s.startsWith("er",index)){
                   index += 2;
               }
               
            }else if (s.startsWith("erase",index)){
                index += 5;
                if (s.startsWith("eraser",index)){
                    index += 6;
                }else if (s.startsWith("r",index)){
                    index += 1;
                }
            }else{
                break;
            }
        }

        System.out.println(res);
        
    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String res = "NO";
        int index = 0;
        while (true){
            if (s.length() == index){
                res = "YES";
                break;
            }
            if (s.length() - index < 5){
                break;
            }
            
            if(s.startsWith("dream",index)){
               index += 5; 
               if (s.startsWith("eraser",index)){
                   index += 6;
               }else if (s.startsWith("erase",index)){
                   index += 5;
               }else if (s.startsWith("er",index)){
                   index += 2;
               }
               
            }else if (s.startsWith("erase",index)){
                index += 5;
                if (s.startsWith("eraser",index)){
                    index += 6;
                }else if (s.startsWith("r",index)){
                    index += 1;
                }
            }else{
                break;
            }
        }

        System.out.println(res);
        
    }

}
