import java.util.*;

public class Main {
    public static void main(String[] args) {
        try(Scanner sc = new Scanner(System.in);) {
            String src = sc.nextLine();
            String res = src.replaceAll("eraser", "").replaceAll("erase", "").replaceAll("dreamer", "").replaceAll("dream", "");
            System.out.println(res.length() == 0 ? "YES" : "NO");
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        try(Scanner sc = new Scanner(System.in);) {
            String src = sc.nextLine();
            String res = src.replaceAll("eraser", "").replaceAll("erase", "").replaceAll("dreamer", "").replaceAll("dream", "");
            System.out.println(res.length() == 0 ? "YES" : "NO");
        }
    }
} Main public static void main(String[] args) {
        try(Scanner sc = new Scanner(System.in);) {
            String src = sc.nextLine();
            String res = src.replaceAll("eraser", "").replaceAll("erase", "").replaceAll("dreamer", "").replaceAll("dream", "");
            System.out.println(res.length() == 0 ? "YES" : "NO");
        }
    } main {
        try(Scanner sc = new Scanner(System.in);) {
            String src = sc.nextLine();
            String res = src.replaceAll("eraser", "").replaceAll("erase", "").replaceAll("dreamer", "").replaceAll("dream", "");
            System.out.println(res.length() == 0 ? "YES" : "NO");
        }
    } try(Scanner sc = new Scanner(System.in);) {
            String src = sc.nextLine();
            String res = src.replaceAll("eraser", "").replaceAll("erase", "").replaceAll("dreamer", "").replaceAll("dream", "");
            System.out.println(res.length() == 0 ? "YES" : "NO");
        } {
            String src = sc.nextLine();
            String res = src.replaceAll("eraser", "").replaceAll("erase", "").replaceAll("dreamer", "").replaceAll("dream", "");
            System.out.println(res.length() == 0 ? "YES" : "NO");
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) String src = sc.nextLine(); src sc.nextLine() sc.nextLine sc String res = src.replaceAll("eraser", "").replaceAll("erase", "").replaceAll("dreamer", "").replaceAll("dream", ""); res src.replaceAll("eraser", "").replaceAll("erase", "").replaceAll("dreamer", "").replaceAll("dream", "") src.replaceAll("eraser", "").replaceAll("erase", "").replaceAll("dreamer", "").replaceAll src.replaceAll("eraser", "").replaceAll("erase", "").replaceAll("dreamer", "") src.replaceAll("eraser", "").replaceAll("erase", "").replaceAll src.replaceAll("eraser", "").replaceAll("erase", "") src.replaceAll("eraser", "").replaceAll src.replaceAll("eraser", "") src.replaceAll src "eraser" "" "erase" "" "dreamer" "" "dream" "" System.out.println(res.length() == 0 ? "YES" : "NO") System.out.println System.out System System.out res.length() == 0 ? "YES" : "NO" res.length() == 0 res.length() res.length res 0 "YES" "NO" String[] args args public class Main {
    public static void main(String[] args) {
        try(Scanner sc = new Scanner(System.in);) {
            String src = sc.nextLine();
            String res = src.replaceAll("eraser", "").replaceAll("erase", "").replaceAll("dreamer", "").replaceAll("dream", "");
            System.out.println(res.length() == 0 ? "YES" : "NO");
        }
    }
} public class Main {
    public static void main(String[] args) {
        try(Scanner sc = new Scanner(System.in);) {
            String src = sc.nextLine();
            String res = src.replaceAll("eraser", "").replaceAll("erase", "").replaceAll("dreamer", "").replaceAll("dream", "");
            System.out.println(res.length() == 0 ? "YES" : "NO");
        }
    }
} Main
import java.util.*;

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