import java.util.Scanner;
import java.util.Arrays;

public class Main {

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

    void solve() {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        S = S.replaceAll("eraser", "");
        S = S.replaceAll("erase", "");
        S = S.replaceAll("dreamer", "");
        S = S.replaceAll("dream", "");
        boolean ans = S.isEmpty();
        if (ans) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }

    }

} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main {

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

    void solve() {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        S = S.replaceAll("eraser", "");
        S = S.replaceAll("erase", "");
        S = S.replaceAll("dreamer", "");
        S = S.replaceAll("dream", "");
        boolean ans = S.isEmpty();
        if (ans) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }

    }

} Main public static void main(String[] args) {
        new Main().solve();
    } main {
        new Main().solve();
    } new Main().solve() new Main().solve new Main() String[] args args void solve() {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        S = S.replaceAll("eraser", "");
        S = S.replaceAll("erase", "");
        S = S.replaceAll("dreamer", "");
        S = S.replaceAll("dream", "");
        boolean ans = S.isEmpty();
        if (ans) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }

    } solve {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        S = S.replaceAll("eraser", "");
        S = S.replaceAll("erase", "");
        S = S.replaceAll("dreamer", "");
        S = S.replaceAll("dream", "");
        boolean ans = S.isEmpty();
        if (ans) {
            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 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" "" boolean ans = S.isEmpty(); ans S.isEmpty() S.isEmpty S if (ans) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        } ans {
            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 class Main {

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

    void solve() {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        S = S.replaceAll("eraser", "");
        S = S.replaceAll("erase", "");
        S = S.replaceAll("dreamer", "");
        S = S.replaceAll("dream", "");
        boolean ans = S.isEmpty();
        if (ans) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }

    }

} public class Main {

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

    void solve() {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        S = S.replaceAll("eraser", "");
        S = S.replaceAll("erase", "");
        S = S.replaceAll("dreamer", "");
        S = S.replaceAll("dream", "");
        boolean ans = S.isEmpty();
        if (ans) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }

    }

} Main
import java.util.Scanner;
import java.util.Arrays;

public class Main {

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

    void solve() {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        S = S.replaceAll("eraser", "");
        S = S.replaceAll("erase", "");
        S = S.replaceAll("dreamer", "");
        S = S.replaceAll("dream", "");
        boolean ans = S.isEmpty();
        if (ans) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }

    }

}