import java.io.BufferedReader;
import java.io.InputStreamReader;

import java.util.Arrays;
import java.util.Collections;
import java.util.ArrayList;
import java.util.List;
import java.util.HashSet;
import java.io.PrintWriter;
import java.io.OutputStream;

public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    // 標準入力数値配列用 integer ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
	// write your code here
        String s = br.readLine().trim();
        int stPo = 0;

        while (s.length() > stPo){
            int endPo5 = stPo + 5;
            int endPo6 = stPo + 6;
            int endPo7 = stPo + 7;

            if (s.length() >= stPo + 7 && s.substring(stPo,endPo7).equals("dreamer") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 7;

            }else if(s.length() >= stPo + 6 && s.substring(stPo,endPo6).equals("eraser") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 6;

            }else if (s.length() >= stPo + 5 && (s.substring(stPo,endPo5).equals("dream") || s.substring(stPo,endPo5).equals("erase"))){
                stPo += 5;

            }else{
                System.out.println("NO");
                return;
            }
        }

        System.out.println("YES");
    }

}
 import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.HashSet; HashSet java.util import java.io.PrintWriter; PrintWriter java.io import java.io.OutputStream; OutputStream java.io public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    // 標準入力数値配列用 integer ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
	// write your code here
        String s = br.readLine().trim();
        int stPo = 0;

        while (s.length() > stPo){
            int endPo5 = stPo + 5;
            int endPo6 = stPo + 6;
            int endPo7 = stPo + 7;

            if (s.length() >= stPo + 7 && s.substring(stPo,endPo7).equals("dreamer") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 7;

            }else if(s.length() >= stPo + 6 && s.substring(stPo,endPo6).equals("eraser") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 6;

            }else if (s.length() >= stPo + 5 && (s.substring(stPo,endPo5).equals("dream") || s.substring(stPo,endPo5).equals("erase"))){
                stPo += 5;

            }else{
                System.out.println("NO");
                return;
            }
        }

        System.out.println("YES");
    }

} Main // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    } inputval {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    } String[] strarray = br.readLine().trim().split(" "); strarray br.readLine().trim().split(" ") br.readLine().trim().split br.readLine().trim() br.readLine().trim br.readLine() br.readLine br " " int[] intarray = new int[strarray.length]; intarray new int[strarray.length] strarray.length strarray strarray.length for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        } int i = 0; int i = 0; i 0 i < intarray.length i intarray.length intarray intarray.length i++ i++ i {
            intarray[i] = Integer.parseInt(strarray[i]);
        } {
            intarray[i] = Integer.parseInt(strarray[i]);
        } intarray[i] = Integer.parseInt(strarray[i]) intarray[i] intarray i Integer.parseInt(strarray[i]) Integer.parseInt Integer strarray[i] strarray i return intarray; intarray // 標準入力数値配列用 integer ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    } inputvalInteger {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    } String[] strarray = br.readLine().trim().split(" "); strarray br.readLine().trim().split(" ") br.readLine().trim().split br.readLine().trim() br.readLine().trim br.readLine() br.readLine br " " Integer[] intarray = new Integer[strarray.length]; intarray new Integer[strarray.length] strarray.length strarray strarray.length for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        } int i = 0; int i = 0; i 0 i < intarray.length i intarray.length intarray intarray.length i++ i++ i {
            intarray[i] = Integer.parseInt(strarray[i]);
        } {
            intarray[i] = Integer.parseInt(strarray[i]);
        } intarray[i] = Integer.parseInt(strarray[i]) intarray[i] intarray i Integer.parseInt(strarray[i]) Integer.parseInt Integer strarray[i] strarray i return intarray; intarray public static void main(String[] args) throws Exception {
	// write your code here
        String s = br.readLine().trim();
        int stPo = 0;

        while (s.length() > stPo){
            int endPo5 = stPo + 5;
            int endPo6 = stPo + 6;
            int endPo7 = stPo + 7;

            if (s.length() >= stPo + 7 && s.substring(stPo,endPo7).equals("dreamer") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 7;

            }else if(s.length() >= stPo + 6 && s.substring(stPo,endPo6).equals("eraser") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 6;

            }else if (s.length() >= stPo + 5 && (s.substring(stPo,endPo5).equals("dream") || s.substring(stPo,endPo5).equals("erase"))){
                stPo += 5;

            }else{
                System.out.println("NO");
                return;
            }
        }

        System.out.println("YES");
    } main {
	// write your code here
        String s = br.readLine().trim();
        int stPo = 0;

        while (s.length() > stPo){
            int endPo5 = stPo + 5;
            int endPo6 = stPo + 6;
            int endPo7 = stPo + 7;

            if (s.length() >= stPo + 7 && s.substring(stPo,endPo7).equals("dreamer") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 7;

            }else if(s.length() >= stPo + 6 && s.substring(stPo,endPo6).equals("eraser") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 6;

            }else if (s.length() >= stPo + 5 && (s.substring(stPo,endPo5).equals("dream") || s.substring(stPo,endPo5).equals("erase"))){
                stPo += 5;

            }else{
                System.out.println("NO");
                return;
            }
        }

        System.out.println("YES");
    } String s = br.readLine().trim(); s br.readLine().trim() br.readLine().trim br.readLine() br.readLine br int stPo = 0; stPo 0 while (s.length() > stPo){
            int endPo5 = stPo + 5;
            int endPo6 = stPo + 6;
            int endPo7 = stPo + 7;

            if (s.length() >= stPo + 7 && s.substring(stPo,endPo7).equals("dreamer") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 7;

            }else if(s.length() >= stPo + 6 && s.substring(stPo,endPo6).equals("eraser") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 6;

            }else if (s.length() >= stPo + 5 && (s.substring(stPo,endPo5).equals("dream") || s.substring(stPo,endPo5).equals("erase"))){
                stPo += 5;

            }else{
                System.out.println("NO");
                return;
            }
        } s.length() > stPo s.length() s.length s stPo {
            int endPo5 = stPo + 5;
            int endPo6 = stPo + 6;
            int endPo7 = stPo + 7;

            if (s.length() >= stPo + 7 && s.substring(stPo,endPo7).equals("dreamer") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 7;

            }else if(s.length() >= stPo + 6 && s.substring(stPo,endPo6).equals("eraser") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 6;

            }else if (s.length() >= stPo + 5 && (s.substring(stPo,endPo5).equals("dream") || s.substring(stPo,endPo5).equals("erase"))){
                stPo += 5;

            }else{
                System.out.println("NO");
                return;
            }
        } int endPo5 = stPo + 5; endPo5 stPo + 5 stPo 5 int endPo6 = stPo + 6; endPo6 stPo + 6 stPo 6 int endPo7 = stPo + 7; endPo7 stPo + 7 stPo 7 if (s.length() >= stPo + 7 && s.substring(stPo,endPo7).equals("dreamer") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 7;

            }else if(s.length() >= stPo + 6 && s.substring(stPo,endPo6).equals("eraser") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 6;

            }else if (s.length() >= stPo + 5 && (s.substring(stPo,endPo5).equals("dream") || s.substring(stPo,endPo5).equals("erase"))){
                stPo += 5;

            }else{
                System.out.println("NO");
                return;
            } s.length() >= stPo + 7 && s.substring(stPo,endPo7).equals("dreamer") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase")) s.length() >= stPo + 7 && s.substring(stPo,endPo7).equals("dreamer") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase")) s.length() >= stPo + 7 s.length() s.length s stPo + 7 stPo 7 s.substring(stPo,endPo7).equals("dreamer") s.substring(stPo,endPo7).equals s.substring(stPo,endPo7) s.substring s stPo endPo7 "dreamer" (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase")) s.length() < stPo+10 s.length() s.length s stPo+10 stPo 10 ! s.substring(endPo5,endPo5+5).equals("erase") s.substring(endPo5,endPo5+5).equals("erase") s.substring(endPo5,endPo5+5).equals s.substring(endPo5,endPo5+5) s.substring s endPo5 endPo5+5 endPo5 5 "erase" {
                stPo += 7;

            } stPo += 7 stPo 7 if(s.length() >= stPo + 6 && s.substring(stPo,endPo6).equals("eraser") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 6;

            }else if (s.length() >= stPo + 5 && (s.substring(stPo,endPo5).equals("dream") || s.substring(stPo,endPo5).equals("erase"))){
                stPo += 5;

            }else{
                System.out.println("NO");
                return;
            } s.length() >= stPo + 6 && s.substring(stPo,endPo6).equals("eraser") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase")) s.length() >= stPo + 6 && s.substring(stPo,endPo6).equals("eraser") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase")) s.length() >= stPo + 6 s.length() s.length s stPo + 6 stPo 6 s.substring(stPo,endPo6).equals("eraser") s.substring(stPo,endPo6).equals s.substring(stPo,endPo6) s.substring s stPo endPo6 "eraser" (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase")) s.length() < stPo+10 s.length() s.length s stPo+10 stPo 10 ! s.substring(endPo5,endPo5+5).equals("erase") s.substring(endPo5,endPo5+5).equals("erase") s.substring(endPo5,endPo5+5).equals s.substring(endPo5,endPo5+5) s.substring s endPo5 endPo5+5 endPo5 5 "erase" {
                stPo += 6;

            } stPo += 6 stPo 6 if (s.length() >= stPo + 5 && (s.substring(stPo,endPo5).equals("dream") || s.substring(stPo,endPo5).equals("erase"))){
                stPo += 5;

            }else{
                System.out.println("NO");
                return;
            } s.length() >= stPo + 5 && (s.substring(stPo,endPo5).equals("dream") || s.substring(stPo,endPo5).equals("erase")) s.length() >= stPo + 5 s.length() s.length s stPo + 5 stPo 5 (s.substring(stPo,endPo5).equals("dream") || s.substring(stPo,endPo5).equals("erase")) s.substring(stPo,endPo5).equals("dream") s.substring(stPo,endPo5).equals s.substring(stPo,endPo5) s.substring s stPo endPo5 "dream" s.substring(stPo,endPo5).equals("erase") s.substring(stPo,endPo5).equals s.substring(stPo,endPo5) s.substring s stPo endPo5 "erase" {
                stPo += 5;

            } stPo += 5 stPo 5 {
                System.out.println("NO");
                return;
            } System.out.println("NO") System.out.println System.out System System.out "NO" return; System.out.println("YES") System.out.println System.out System System.out "YES" String[] args args public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    // 標準入力数値配列用 integer ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
	// write your code here
        String s = br.readLine().trim();
        int stPo = 0;

        while (s.length() > stPo){
            int endPo5 = stPo + 5;
            int endPo6 = stPo + 6;
            int endPo7 = stPo + 7;

            if (s.length() >= stPo + 7 && s.substring(stPo,endPo7).equals("dreamer") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 7;

            }else if(s.length() >= stPo + 6 && s.substring(stPo,endPo6).equals("eraser") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 6;

            }else if (s.length() >= stPo + 5 && (s.substring(stPo,endPo5).equals("dream") || s.substring(stPo,endPo5).equals("erase"))){
                stPo += 5;

            }else{
                System.out.println("NO");
                return;
            }
        }

        System.out.println("YES");
    }

} public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    // 標準入力数値配列用 integer ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
	// write your code here
        String s = br.readLine().trim();
        int stPo = 0;

        while (s.length() > stPo){
            int endPo5 = stPo + 5;
            int endPo6 = stPo + 6;
            int endPo7 = stPo + 7;

            if (s.length() >= stPo + 7 && s.substring(stPo,endPo7).equals("dreamer") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 7;

            }else if(s.length() >= stPo + 6 && s.substring(stPo,endPo6).equals("eraser") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 6;

            }else if (s.length() >= stPo + 5 && (s.substring(stPo,endPo5).equals("dream") || s.substring(stPo,endPo5).equals("erase"))){
                stPo += 5;

            }else{
                System.out.println("NO");
                return;
            }
        }

        System.out.println("YES");
    }

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

import java.util.Arrays;
import java.util.Collections;
import java.util.ArrayList;
import java.util.List;
import java.util.HashSet;
import java.io.PrintWriter;
import java.io.OutputStream;

public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    // 標準入力数値配列用 integer ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
	// write your code here
        String s = br.readLine().trim();
        int stPo = 0;

        while (s.length() > stPo){
            int endPo5 = stPo + 5;
            int endPo6 = stPo + 6;
            int endPo7 = stPo + 7;

            if (s.length() >= stPo + 7 && s.substring(stPo,endPo7).equals("dreamer") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 7;

            }else if(s.length() >= stPo + 6 && s.substring(stPo,endPo6).equals("eraser") && (s.length() < stPo+10 || ! s.substring(endPo5,endPo5+5).equals("erase"))){
                stPo += 6;

            }else if (s.length() >= stPo + 5 && (s.substring(stPo,endPo5).equals("dream") || s.substring(stPo,endPo5).equals("erase"))){
                stPo += 5;

            }else{
                System.out.println("NO");
                return;
            }
        }

        System.out.println("YES");
    }

}

