import java.util.*;

public class Main{
    Scanner in = new Scanner(System.in);

    void solve(){
        String s = in.nextLine();
        int a = s.replace("dreamer", "").replace("dream", "").replace("eraser", "").replace("erase", "").length();
        int b = s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "").length();
        if(a == 0 || b == 0){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }

    public static void main(String[] args){
        new Main().solve();
    }
} import java.util.*; util.* java public class Main{
    Scanner in = new Scanner(System.in);

    void solve(){
        String s = in.nextLine();
        int a = s.replace("dreamer", "").replace("dream", "").replace("eraser", "").replace("erase", "").length();
        int b = s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "").length();
        if(a == 0 || b == 0){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }

    public static void main(String[] args){
        new Main().solve();
    }
} Main Scanner in = new Scanner(System.in); in new Scanner(System.in) void solve(){
        String s = in.nextLine();
        int a = s.replace("dreamer", "").replace("dream", "").replace("eraser", "").replace("erase", "").length();
        int b = s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "").length();
        if(a == 0 || b == 0){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    } solve {
        String s = in.nextLine();
        int a = s.replace("dreamer", "").replace("dream", "").replace("eraser", "").replace("erase", "").length();
        int b = s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "").length();
        if(a == 0 || b == 0){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    } String s = in.nextLine(); s in.nextLine() in.nextLine in int a = s.replace("dreamer", "").replace("dream", "").replace("eraser", "").replace("erase", "").length(); a s.replace("dreamer", "").replace("dream", "").replace("eraser", "").replace("erase", "").length() s.replace("dreamer", "").replace("dream", "").replace("eraser", "").replace("erase", "").length s.replace("dreamer", "").replace("dream", "").replace("eraser", "").replace("erase", "") s.replace("dreamer", "").replace("dream", "").replace("eraser", "").replace s.replace("dreamer", "").replace("dream", "").replace("eraser", "") s.replace("dreamer", "").replace("dream", "").replace s.replace("dreamer", "").replace("dream", "") s.replace("dreamer", "").replace s.replace("dreamer", "") s.replace s "dreamer" "" "dream" "" "eraser" "" "erase" "" int b = s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "").length(); b s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "").length() s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "").length 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(a == 0 || b == 0){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        } a == 0 || b == 0 a == 0 a 0 b == 0 b 0 {
            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" public static void main(String[] args){
        new Main().solve();
    } main {
        new Main().solve();
    } new Main().solve() new Main().solve new Main() String[] args args public class Main{
    Scanner in = new Scanner(System.in);

    void solve(){
        String s = in.nextLine();
        int a = s.replace("dreamer", "").replace("dream", "").replace("eraser", "").replace("erase", "").length();
        int b = s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "").length();
        if(a == 0 || b == 0){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }

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

    void solve(){
        String s = in.nextLine();
        int a = s.replace("dreamer", "").replace("dream", "").replace("eraser", "").replace("erase", "").length();
        int b = s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "").length();
        if(a == 0 || b == 0){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }

    public static void main(String[] args){
        new Main().solve();
    }
} Main
import java.util.*;

public class Main{
    Scanner in = new Scanner(System.in);

    void solve(){
        String s = in.nextLine();
        int a = s.replace("dreamer", "").replace("dream", "").replace("eraser", "").replace("erase", "").length();
        int b = s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "").length();
        if(a == 0 || b == 0){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }

    public static void main(String[] args){
        new Main().solve();
    }
}