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

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

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

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

        else {
            System.out.println("NO");
        }
        
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc if (s.replaceAll("eraser", "").replaceAll("erase", "").replaceAll("dreamer", "").replaceAll("dream", "")
                .equals("")) {
            System.out.println("YES");
        
        } 

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

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

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

        else {
            System.out.println("NO");
        }
        
        sc.close();
    }
}