import java.util.*;

/**
 * Created by Seiya on 2016/10/16.
 */
public class Main {

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

        String t = scanner.next();
        String s = new String();


        String[] mozi = new String[4];

        mozi[0] = "dream";
        mozi[1] = "dreamer";
        mozi[2] = "erase";
        mozi[3] = "eraser";

        int ok = -1;
        String temp = new String();
        int min;
        int len = t.length();
        while(ok == -1){

            for (int i = 0; i < 4; i++) {
                min = Math.min(len, mozi[i].length());
                 temp = t.substring(len - min, len);
                if(temp.equals(mozi[i])){
                    len -= min;
                    ok = -1;
                    break;
                }
                ok = 0;
            }
            if(len == 0){
                ok = 1;
            }

        }
        if(ok == 0){
            System.out.println("NO");
        }else {
            System.out.println("YES");
        }


    }


    public static String reverse(String s){
        String ans = new String();

        for (int i = s.length() - 1; i >= 0; i--) {
            ans = ans + s.charAt(i);
        }

        return ans;
    }
}

 import java.util.*; util.* java public class Main {

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

        String t = scanner.next();
        String s = new String();


        String[] mozi = new String[4];

        mozi[0] = "dream";
        mozi[1] = "dreamer";
        mozi[2] = "erase";
        mozi[3] = "eraser";

        int ok = -1;
        String temp = new String();
        int min;
        int len = t.length();
        while(ok == -1){

            for (int i = 0; i < 4; i++) {
                min = Math.min(len, mozi[i].length());
                 temp = t.substring(len - min, len);
                if(temp.equals(mozi[i])){
                    len -= min;
                    ok = -1;
                    break;
                }
                ok = 0;
            }
            if(len == 0){
                ok = 1;
            }

        }
        if(ok == 0){
            System.out.println("NO");
        }else {
            System.out.println("YES");
        }


    }


    public static String reverse(String s){
        String ans = new String();

        for (int i = s.length() - 1; i >= 0; i--) {
            ans = ans + s.charAt(i);
        }

        return ans;
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String t = scanner.next();
        String s = new String();


        String[] mozi = new String[4];

        mozi[0] = "dream";
        mozi[1] = "dreamer";
        mozi[2] = "erase";
        mozi[3] = "eraser";

        int ok = -1;
        String temp = new String();
        int min;
        int len = t.length();
        while(ok == -1){

            for (int i = 0; i < 4; i++) {
                min = Math.min(len, mozi[i].length());
                 temp = t.substring(len - min, len);
                if(temp.equals(mozi[i])){
                    len -= min;
                    ok = -1;
                    break;
                }
                ok = 0;
            }
            if(len == 0){
                ok = 1;
            }

        }
        if(ok == 0){
            System.out.println("NO");
        }else {
            System.out.println("YES");
        }


    } main {
        Scanner scanner = new Scanner(System.in);

        String t = scanner.next();
        String s = new String();


        String[] mozi = new String[4];

        mozi[0] = "dream";
        mozi[1] = "dreamer";
        mozi[2] = "erase";
        mozi[3] = "eraser";

        int ok = -1;
        String temp = new String();
        int min;
        int len = t.length();
        while(ok == -1){

            for (int i = 0; i < 4; i++) {
                min = Math.min(len, mozi[i].length());
                 temp = t.substring(len - min, len);
                if(temp.equals(mozi[i])){
                    len -= min;
                    ok = -1;
                    break;
                }
                ok = 0;
            }
            if(len == 0){
                ok = 1;
            }

        }
        if(ok == 0){
            System.out.println("NO");
        }else {
            System.out.println("YES");
        }


    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String t = scanner.next(); t scanner.next() scanner.next scanner String s = new String(); s new String() String[] mozi = new String[4]; mozi new String[4] 4 mozi[0] = "dream" mozi[0] mozi 0 "dream" mozi[1] = "dreamer" mozi[1] mozi 1 "dreamer" mozi[2] = "erase" mozi[2] mozi 2 "erase" mozi[3] = "eraser" mozi[3] mozi 3 "eraser" int ok = -1; ok -1 1 String temp = new String(); temp new String() int min; min int len = t.length(); len t.length() t.length t while(ok == -1){

            for (int i = 0; i < 4; i++) {
                min = Math.min(len, mozi[i].length());
                 temp = t.substring(len - min, len);
                if(temp.equals(mozi[i])){
                    len -= min;
                    ok = -1;
                    break;
                }
                ok = 0;
            }
            if(len == 0){
                ok = 1;
            }

        } ok == -1 ok -1 1 {

            for (int i = 0; i < 4; i++) {
                min = Math.min(len, mozi[i].length());
                 temp = t.substring(len - min, len);
                if(temp.equals(mozi[i])){
                    len -= min;
                    ok = -1;
                    break;
                }
                ok = 0;
            }
            if(len == 0){
                ok = 1;
            }

        } for (int i = 0; i < 4; i++) {
                min = Math.min(len, mozi[i].length());
                 temp = t.substring(len - min, len);
                if(temp.equals(mozi[i])){
                    len -= min;
                    ok = -1;
                    break;
                }
                ok = 0;
            } int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
                min = Math.min(len, mozi[i].length());
                 temp = t.substring(len - min, len);
                if(temp.equals(mozi[i])){
                    len -= min;
                    ok = -1;
                    break;
                }
                ok = 0;
            } {
                min = Math.min(len, mozi[i].length());
                 temp = t.substring(len - min, len);
                if(temp.equals(mozi[i])){
                    len -= min;
                    ok = -1;
                    break;
                }
                ok = 0;
            } min = Math.min(len, mozi[i].length()) min Math.min(len, mozi[i].length()) Math.min Math len mozi[i].length() mozi[i].length mozi[i] mozi i temp = t.substring(len - min, len) temp t.substring(len - min, len) t.substring t len - min len min len if(temp.equals(mozi[i])){
                    len -= min;
                    ok = -1;
                    break;
                } temp.equals(mozi[i]) temp.equals temp mozi[i] mozi i {
                    len -= min;
                    ok = -1;
                    break;
                } len -= min len min ok = -1 ok -1 1 break; ok = 0 ok 0 if(len == 0){
                ok = 1;
            } len == 0 len 0 {
                ok = 1;
            } ok = 1 ok 1 if(ok == 0){
            System.out.println("NO");
        }else {
            System.out.println("YES");
        } ok == 0 ok 0 {
            System.out.println("NO");
        } System.out.println("NO") System.out.println System.out System System.out "NO" {
            System.out.println("YES");
        } System.out.println("YES") System.out.println System.out System System.out "YES" String[] args args public static String reverse(String s){
        String ans = new String();

        for (int i = s.length() - 1; i >= 0; i--) {
            ans = ans + s.charAt(i);
        }

        return ans;
    } reverse {
        String ans = new String();

        for (int i = s.length() - 1; i >= 0; i--) {
            ans = ans + s.charAt(i);
        }

        return ans;
    } String ans = new String(); ans new String() for (int i = s.length() - 1; i >= 0; i--) {
            ans = ans + s.charAt(i);
        } int i = s.length() - 1; int i = s.length() - 1; i s.length() - 1 s.length() s.length s 1 i >= 0 i 0 i-- i-- i {
            ans = ans + s.charAt(i);
        } {
            ans = ans + s.charAt(i);
        } ans = ans + s.charAt(i) ans ans + s.charAt(i) ans s.charAt(i) s.charAt s i return ans; ans String s s public class Main {

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

        String t = scanner.next();
        String s = new String();


        String[] mozi = new String[4];

        mozi[0] = "dream";
        mozi[1] = "dreamer";
        mozi[2] = "erase";
        mozi[3] = "eraser";

        int ok = -1;
        String temp = new String();
        int min;
        int len = t.length();
        while(ok == -1){

            for (int i = 0; i < 4; i++) {
                min = Math.min(len, mozi[i].length());
                 temp = t.substring(len - min, len);
                if(temp.equals(mozi[i])){
                    len -= min;
                    ok = -1;
                    break;
                }
                ok = 0;
            }
            if(len == 0){
                ok = 1;
            }

        }
        if(ok == 0){
            System.out.println("NO");
        }else {
            System.out.println("YES");
        }


    }


    public static String reverse(String s){
        String ans = new String();

        for (int i = s.length() - 1; i >= 0; i--) {
            ans = ans + s.charAt(i);
        }

        return ans;
    }
} public class Main {

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

        String t = scanner.next();
        String s = new String();


        String[] mozi = new String[4];

        mozi[0] = "dream";
        mozi[1] = "dreamer";
        mozi[2] = "erase";
        mozi[3] = "eraser";

        int ok = -1;
        String temp = new String();
        int min;
        int len = t.length();
        while(ok == -1){

            for (int i = 0; i < 4; i++) {
                min = Math.min(len, mozi[i].length());
                 temp = t.substring(len - min, len);
                if(temp.equals(mozi[i])){
                    len -= min;
                    ok = -1;
                    break;
                }
                ok = 0;
            }
            if(len == 0){
                ok = 1;
            }

        }
        if(ok == 0){
            System.out.println("NO");
        }else {
            System.out.println("YES");
        }


    }


    public static String reverse(String s){
        String ans = new String();

        for (int i = s.length() - 1; i >= 0; i--) {
            ans = ans + s.charAt(i);
        }

        return ans;
    }
} Main
import java.util.*;

/**
 * Created by Seiya on 2016/10/16.
 */
public class Main {

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

        String t = scanner.next();
        String s = new String();


        String[] mozi = new String[4];

        mozi[0] = "dream";
        mozi[1] = "dreamer";
        mozi[2] = "erase";
        mozi[3] = "eraser";

        int ok = -1;
        String temp = new String();
        int min;
        int len = t.length();
        while(ok == -1){

            for (int i = 0; i < 4; i++) {
                min = Math.min(len, mozi[i].length());
                 temp = t.substring(len - min, len);
                if(temp.equals(mozi[i])){
                    len -= min;
                    ok = -1;
                    break;
                }
                ok = 0;
            }
            if(len == 0){
                ok = 1;
            }

        }
        if(ok == 0){
            System.out.println("NO");
        }else {
            System.out.println("YES");
        }


    }


    public static String reverse(String s){
        String ans = new String();

        for (int i = s.length() - 1; i >= 0; i--) {
            ans = ans + s.charAt(i);
        }

        return ans;
    }
}


