import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Stream;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.next();
        String[] list = {"eraser", "erase", "dreamer", "dream"};

        for(String l: list){
            line = line.replaceAll(l, "");
        }

        if(line.length() != 0){
            System.out.println("NO");
        } else {
            System.out.println("YES");
        }
    }
} import java.lang.reflect.Array; Array java.lang.reflect import java.math.BigDecimal; BigDecimal java.math import java.util.*; util.* java import java.util.stream.Stream; Stream java.util.stream public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.next();
        String[] list = {"eraser", "erase", "dreamer", "dream"};

        for(String l: list){
            line = line.replaceAll(l, "");
        }

        if(line.length() != 0){
            System.out.println("NO");
        } else {
            System.out.println("YES");
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.next();
        String[] list = {"eraser", "erase", "dreamer", "dream"};

        for(String l: list){
            line = line.replaceAll(l, "");
        }

        if(line.length() != 0){
            System.out.println("NO");
        } else {
            System.out.println("YES");
        }
    } main {
        Scanner sc = new Scanner(System.in);
        String line = sc.next();
        String[] list = {"eraser", "erase", "dreamer", "dream"};

        for(String l: list){
            line = line.replaceAll(l, "");
        }

        if(line.length() != 0){
            System.out.println("NO");
        } else {
            System.out.println("YES");
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.next(); line sc.next() sc.next sc String[] list = {"eraser", "erase", "dreamer", "dream"}; list {"eraser", "erase", "dreamer", "dream"} "eraser" "erase" "dreamer" "dream" for(String l: list){
            line = line.replaceAll(l, "");
        } String l list {
            line = line.replaceAll(l, "");
        } {
            line = line.replaceAll(l, "");
        } line = line.replaceAll(l, "") line line.replaceAll(l, "") line.replaceAll line l "" if(line.length() != 0){
            System.out.println("NO");
        } else {
            System.out.println("YES");
        } line.length() != 0 line.length() line.length line 0 {
            System.out.println("NO");
        } System.out.println("NO") System.out.println System.out System System.out "NO" {
            System.out.println("YES");
        } System.out.println("YES") System.out.println System.out System System.out "YES" String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.next();
        String[] list = {"eraser", "erase", "dreamer", "dream"};

        for(String l: list){
            line = line.replaceAll(l, "");
        }

        if(line.length() != 0){
            System.out.println("NO");
        } else {
            System.out.println("YES");
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.next();
        String[] list = {"eraser", "erase", "dreamer", "dream"};

        for(String l: list){
            line = line.replaceAll(l, "");
        }

        if(line.length() != 0){
            System.out.println("NO");
        } else {
            System.out.println("YES");
        }
    }
} Main
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Stream;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.next();
        String[] list = {"eraser", "erase", "dreamer", "dream"};

        for(String l: list){
            line = line.replaceAll(l, "");
        }

        if(line.length() != 0){
            System.out.println("NO");
        } else {
            System.out.println("YES");
        }
    }
}
