import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();

        String replaced = S
                .replaceAll("eraser", "")
                .replaceAll("erase", "")
                .replaceAll("dreamer", "")
                .replaceAll("dream", "");
        System.out.println(replaced.length()==0 ? "YES" : "NO");
    }
} 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.next();

        String replaced = S
                .replaceAll("eraser", "")
                .replaceAll("erase", "")
                .replaceAll("dreamer", "")
                .replaceAll("dream", "");
        System.out.println(replaced.length()==0 ? "YES" : "NO");
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();

        String replaced = S
                .replaceAll("eraser", "")
                .replaceAll("erase", "")
                .replaceAll("dreamer", "")
                .replaceAll("dream", "");
        System.out.println(replaced.length()==0 ? "YES" : "NO");
    } main {
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();

        String replaced = S
                .replaceAll("eraser", "")
                .replaceAll("erase", "")
                .replaceAll("dreamer", "")
                .replaceAll("dream", "");
        System.out.println(replaced.length()==0 ? "YES" : "NO");
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String S = scanner.next(); S scanner.next() scanner.next scanner String replaced = S
                .replaceAll("eraser", "")
                .replaceAll("erase", "")
                .replaceAll("dreamer", "")
                .replaceAll("dream", ""); replaced S
                .replaceAll("eraser", "")
                .replaceAll("erase", "")
                .replaceAll("dreamer", "")
                .replaceAll("dream", "") S
                .replaceAll("eraser", "")
                .replaceAll("erase", "")
                .replaceAll("dreamer", "")
                .replaceAll S
                .replaceAll("eraser", "")
                .replaceAll("erase", "")
                .replaceAll("dreamer", "") S
                .replaceAll("eraser", "")
                .replaceAll("erase", "")
                .replaceAll S
                .replaceAll("eraser", "")
                .replaceAll("erase", "") S
                .replaceAll("eraser", "")
                .replaceAll S
                .replaceAll("eraser", "") S
                .replaceAll S "eraser" "" "erase" "" "dreamer" "" "dream" "" System.out.println(replaced.length()==0 ? "YES" : "NO") System.out.println System.out System System.out replaced.length()==0 ? "YES" : "NO" replaced.length()==0 replaced.length() replaced.length replaced 0 "YES" "NO" String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();

        String replaced = S
                .replaceAll("eraser", "")
                .replaceAll("erase", "")
                .replaceAll("dreamer", "")
                .replaceAll("dream", "");
        System.out.println(replaced.length()==0 ? "YES" : "NO");
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();

        String replaced = S
                .replaceAll("eraser", "")
                .replaceAll("erase", "")
                .replaceAll("dreamer", "")
                .replaceAll("dream", "");
        System.out.println(replaced.length()==0 ? "YES" : "NO");
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();

        String replaced = S
                .replaceAll("eraser", "")
                .replaceAll("erase", "")
                .replaceAll("dreamer", "")
                .replaceAll("dream", "");
        System.out.println(replaced.length()==0 ? "YES" : "NO");
    }
}
