import java.util.Scanner;

public class Main {

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

        final String S = sc.next();
        final String ans = S
                .replace("eraser", "")
                .replace("erase", "")
                .replace("dreamer", "")
                .replace("dream", "");

        System.out.println(ans.length() == 0 ? "YES" : "NO");
    }
} import java.util.Scanner; Scanner java.util public class Main {

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

        final String S = sc.next();
        final String ans = S
                .replace("eraser", "")
                .replace("erase", "")
                .replace("dreamer", "")
                .replace("dream", "");

        System.out.println(ans.length() == 0 ? "YES" : "NO");
    }
} Main public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);

        final String S = sc.next();
        final String ans = S
                .replace("eraser", "")
                .replace("erase", "")
                .replace("dreamer", "")
                .replace("dream", "");

        System.out.println(ans.length() == 0 ? "YES" : "NO");
    } main {
        final Scanner sc = new Scanner(System.in);

        final String S = sc.next();
        final String ans = S
                .replace("eraser", "")
                .replace("erase", "")
                .replace("dreamer", "")
                .replace("dream", "");

        System.out.println(ans.length() == 0 ? "YES" : "NO");
    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final String S = sc.next(); S sc.next() sc.next sc final String ans = S
                .replace("eraser", "")
                .replace("erase", "")
                .replace("dreamer", "")
                .replace("dream", ""); ans 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" "" System.out.println(ans.length() == 0 ? "YES" : "NO") System.out.println System.out System System.out ans.length() == 0 ? "YES" : "NO" ans.length() == 0 ans.length() ans.length ans 0 "YES" "NO" String[] args args public class Main {

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

        final String S = sc.next();
        final String ans = S
                .replace("eraser", "")
                .replace("erase", "")
                .replace("dreamer", "")
                .replace("dream", "");

        System.out.println(ans.length() == 0 ? "YES" : "NO");
    }
} public class Main {

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

        final String S = sc.next();
        final String ans = S
                .replace("eraser", "")
                .replace("erase", "")
                .replace("dreamer", "")
                .replace("dream", "");

        System.out.println(ans.length() == 0 ? "YES" : "NO");
    }
} Main
import java.util.Scanner;

public class Main {

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

        final String S = sc.next();
        final String ans = S
                .replace("eraser", "")
                .replace("erase", "")
                .replace("dreamer", "")
                .replace("dream", "");

        System.out.println(ans.length() == 0 ? "YES" : "NO");
    }
}
