import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String s = sc.nextLine( );
 
        s = s.replaceAll("eraser", "");
        s = s.replaceAll("erase", "");
        s = s.replaceAll("dreamer", "");
        s = s.replaceAll("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( );
 
        s = s.replaceAll("eraser", "");
        s = s.replaceAll("erase", "");
        s = s.replaceAll("dreamer", "");
        s = s.replaceAll("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( );
 
        s = s.replaceAll("eraser", "");
        s = s.replaceAll("erase", "");
        s = s.replaceAll("dreamer", "");
        s = s.replaceAll("dream", "");

        if(s.equals("")){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    } main {
        Scanner sc = new Scanner(System.in);

        String s = sc.nextLine( );
 
        s = s.replaceAll("eraser", "");
        s = s.replaceAll("erase", "");
        s = s.replaceAll("dreamer", "");
        s = s.replaceAll("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 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" "" 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( );
 
        s = s.replaceAll("eraser", "");
        s = s.replaceAll("erase", "");
        s = s.replaceAll("dreamer", "");
        s = s.replaceAll("dream", "");

        if(s.equals("")){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }
}