import java.util.Scanner;

/**
 * Created by zzt on 17-1-16.
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();

        s = s.replaceAll("eraser", "");
        s = s.replaceAll("erase", "");
        s = s.replaceAll("dreamer", "");
        s = s.replaceAll("dream", "");

        System.out.println(s.length()>0?"NO":"YES");
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();

        s = s.replaceAll("eraser", "");
        s = s.replaceAll("erase", "");
        s = s.replaceAll("dreamer", "");
        s = s.replaceAll("dream", "");

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

        s = s.replaceAll("eraser", "");
        s = s.replaceAll("erase", "");
        s = s.replaceAll("dreamer", "");
        s = s.replaceAll("dream", "");

        System.out.println(s.length()>0?"NO":"YES");
    } main {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();

        s = s.replaceAll("eraser", "");
        s = s.replaceAll("erase", "");
        s = s.replaceAll("dreamer", "");
        s = s.replaceAll("dream", "");

        System.out.println(s.length()>0?"NO":"YES");
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String s = scanner.nextLine(); s scanner.nextLine() scanner.nextLine scanner 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" "" System.out.println(s.length()>0?"NO":"YES") System.out.println System.out System System.out s.length()>0?"NO":"YES" s.length()>0 s.length() s.length s 0 "NO" "YES" String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();

        s = s.replaceAll("eraser", "");
        s = s.replaceAll("erase", "");
        s = s.replaceAll("dreamer", "");
        s = s.replaceAll("dream", "");

        System.out.println(s.length()>0?"NO":"YES");
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();

        s = s.replaceAll("eraser", "");
        s = s.replaceAll("erase", "");
        s = s.replaceAll("dreamer", "");
        s = s.replaceAll("dream", "");

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

/**
 * Created by zzt on 17-1-16.
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();

        s = s.replaceAll("eraser", "");
        s = s.replaceAll("erase", "");
        s = s.replaceAll("dreamer", "");
        s = s.replaceAll("dream", "");

        System.out.println(s.length()>0?"NO":"YES");
    }
}