import java.util.*;
 
public class Main{

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

        String S = sc.next();
        sc.close();

        S = S.replace("eraser", "");
        S = S.replace("erase", "");
        S = S.replace("dreamer", "");
        S = S.replace("dream", "");
        
        if(S.equals(""))
            System.out.println("YES");
        else
            System.out.println("NO");
    }
} import java.util.*; util.* java public class Main{

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

        String S = sc.next();
        sc.close();

        S = S.replace("eraser", "");
        S = S.replace("erase", "");
        S = S.replace("dreamer", "");
        S = S.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.next();
        sc.close();

        S = S.replace("eraser", "");
        S = S.replace("erase", "");
        S = S.replace("dreamer", "");
        S = S.replace("dream", "");
        
        if(S.equals(""))
            System.out.println("YES");
        else
            System.out.println("NO");
    } main {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        sc.close();

        S = S.replace("eraser", "");
        S = S.replace("erase", "");
        S = S.replace("dreamer", "");
        S = S.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.next(); S sc.next() sc.next sc sc.close() sc.close sc S = S.replace("eraser", "") S S.replace("eraser", "") S.replace S "eraser" "" S = S.replace("erase", "") S S.replace("erase", "") S.replace S "erase" "" S = S.replace("dreamer", "") S S.replace("dreamer", "") S.replace S "dreamer" "" S = S.replace("dream", "") S S.replace("dream", "") S.replace 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 System.out System System.out "YES" 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[]){
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        sc.close();

        S = S.replace("eraser", "");
        S = S.replace("erase", "");
        S = S.replace("dreamer", "");
        S = S.replace("dream", "");
        
        if(S.equals(""))
            System.out.println("YES");
        else
            System.out.println("NO");
    }
} public class Main{

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

        String S = sc.next();
        sc.close();

        S = S.replace("eraser", "");
        S = S.replace("erase", "");
        S = S.replace("dreamer", "");
        S = S.replace("dream", "");
        
        if(S.equals(""))
            System.out.println("YES");
        else
            System.out.println("NO");
    }
} Main
import java.util.*;
 
public class Main{

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

        String S = sc.next();
        sc.close();

        S = S.replace("eraser", "");
        S = S.replace("erase", "");
        S = S.replace("dreamer", "");
        S = S.replace("dream", "");
        
        if(S.equals(""))
            System.out.println("YES");
        else
            System.out.println("NO");
    }
}