import java.util.Scanner;

public class Main {

    private static Scanner sc = new Scanner(System.in);

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

    private void solve() {

        String s = sc.next();

        s = s.replace("eraser","1");
        s = s.replace("erase","1");
        s = s.replace("dreamer","1");
        s = s.replace("dream","1");
        s = s.replace("1","");
        System.out.println(s.equals("") ? "YES":"NO");
    }
} import java.util.Scanner; Scanner java.util public class Main {

    private static Scanner sc = new Scanner(System.in);

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

    private void solve() {

        String s = sc.next();

        s = s.replace("eraser","1");
        s = s.replace("erase","1");
        s = s.replace("dreamer","1");
        s = s.replace("dream","1");
        s = s.replace("1","");
        System.out.println(s.equals("") ? "YES":"NO");
    }
} Main private static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        Main instance = new Main();
        instance.solve();
    } main {
        Main instance = new Main();
        instance.solve();
    } Main instance = new Main(); instance new Main() instance.solve() instance.solve instance String[] args args private void solve() {

        String s = sc.next();

        s = s.replace("eraser","1");
        s = s.replace("erase","1");
        s = s.replace("dreamer","1");
        s = s.replace("dream","1");
        s = s.replace("1","");
        System.out.println(s.equals("") ? "YES":"NO");
    } solve {

        String s = sc.next();

        s = s.replace("eraser","1");
        s = s.replace("erase","1");
        s = s.replace("dreamer","1");
        s = s.replace("dream","1");
        s = s.replace("1","");
        System.out.println(s.equals("") ? "YES":"NO");
    } String s = sc.next(); s sc.next() sc.next sc s = s.replace("eraser","1") s s.replace("eraser","1") s.replace s "eraser" "1" s = s.replace("erase","1") s s.replace("erase","1") s.replace s "erase" "1" s = s.replace("dreamer","1") s s.replace("dreamer","1") s.replace s "dreamer" "1" s = s.replace("dream","1") s s.replace("dream","1") s.replace s "dream" "1" s = s.replace("1","") s s.replace("1","") s.replace s "1" "" System.out.println(s.equals("") ? "YES":"NO") System.out.println System.out System System.out s.equals("") ? "YES":"NO" s.equals("") s.equals s "" "YES" "NO" public class Main {

    private static Scanner sc = new Scanner(System.in);

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

    private void solve() {

        String s = sc.next();

        s = s.replace("eraser","1");
        s = s.replace("erase","1");
        s = s.replace("dreamer","1");
        s = s.replace("dream","1");
        s = s.replace("1","");
        System.out.println(s.equals("") ? "YES":"NO");
    }
} public class Main {

    private static Scanner sc = new Scanner(System.in);

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

    private void solve() {

        String s = sc.next();

        s = s.replace("eraser","1");
        s = s.replace("erase","1");
        s = s.replace("dreamer","1");
        s = s.replace("dream","1");
        s = s.replace("1","");
        System.out.println(s.equals("") ? "YES":"NO");
    }
} Main
import java.util.Scanner;

public class Main {

    private static Scanner sc = new Scanner(System.in);

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

    private void solve() {

        String s = sc.next();

        s = s.replace("eraser","1");
        s = s.replace("erase","1");
        s = s.replace("dreamer","1");
        s = s.replace("dream","1");
        s = s.replace("1","");
        System.out.println(s.equals("") ? "YES":"NO");
    }
}