import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();

        // 主処理
        String replacedS = s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "");
        boolean judge = replacedS.length() == 0;
        String result = judge ? "YES" : "NO";

        // 出力
        System.out.println(result);
    }
} import java.util.*; util.* java public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();

        // 主処理
        String replacedS = s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "");
        boolean judge = replacedS.length() == 0;
        String result = judge ? "YES" : "NO";

        // 出力
        System.out.println(result);
    }
} Main public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();

        // 主処理
        String replacedS = s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "");
        boolean judge = replacedS.length() == 0;
        String result = judge ? "YES" : "NO";

        // 出力
        System.out.println(result);
    } main {

        // 入力
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();

        // 主処理
        String replacedS = s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "");
        boolean judge = replacedS.length() == 0;
        String result = judge ? "YES" : "NO";

        // 出力
        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc sc.close() sc.close sc String replacedS = s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", ""); replacedS s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "") s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace s.replace("eraser", "").replace("erase", "").replace("dreamer", "") s.replace("eraser", "").replace("erase", "").replace s.replace("eraser", "").replace("erase", "") s.replace("eraser", "").replace s.replace("eraser", "") s.replace s "eraser" "" "erase" "" "dreamer" "" "dream" "" boolean judge = replacedS.length() == 0; judge replacedS.length() == 0 replacedS.length() replacedS.length replacedS 0 String result = judge ? "YES" : "NO"; result judge ? "YES" : "NO" judge "YES" "NO" System.out.println(result) System.out.println System.out System System.out result String args[] args public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();

        // 主処理
        String replacedS = s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "");
        boolean judge = replacedS.length() == 0;
        String result = judge ? "YES" : "NO";

        // 出力
        System.out.println(result);
    }
} public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();

        // 主処理
        String replacedS = s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "");
        boolean judge = replacedS.length() == 0;
        String result = judge ? "YES" : "NO";

        // 出力
        System.out.println(result);
    }
} Main
import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();

        // 主処理
        String replacedS = s.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "");
        boolean judge = replacedS.length() == 0;
        String result = judge ? "YES" : "NO";

        // 出力
        System.out.println(result);
    }
}
