import java.util.Scanner;

class Solver {

    private final String S;

    Solver(Scanner in){
        S = in.next();
    }

    void solve() {
        System.out.println(S.matches("(dream(er)?|eraser?)+") ? "YES" : "NO");
    }
}

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

        new Solver(in).solve();

        in.close();
    }
} import java.util.Scanner; Scanner java.util class Solver {

    private final String S;

    Solver(Scanner in){
        S = in.next();
    }

    void solve() {
        System.out.println(S.matches("(dream(er)?|eraser?)+") ? "YES" : "NO");
    }
} Solver private final String S; S Solver(Scanner in){
        S = in.next();
    } Solver {
        S = in.next();
    } S = in.next() S in.next() in.next in Scanner in in void solve() {
        System.out.println(S.matches("(dream(er)?|eraser?)+") ? "YES" : "NO");
    } solve {
        System.out.println(S.matches("(dream(er)?|eraser?)+") ? "YES" : "NO");
    } System.out.println(S.matches("(dream(er)?|eraser?)+") ? "YES" : "NO") System.out.println System.out System System.out S.matches("(dream(er)?|eraser?)+") ? "YES" : "NO" S.matches("(dream(er)?|eraser?)+") S.matches S "(dream(er)?|eraser?)+" "YES" "NO" class Main{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);

        new Solver(in).solve();

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

        new Solver(in).solve();

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

        new Solver(in).solve();

        in.close();
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) new Solver(in).solve() new Solver(in).solve new Solver(in) in.close() in.close in String[] args args
import java.util.Scanner;

class Solver {

    private final String S;

    Solver(Scanner in){
        S = in.next();
    }

    void solve() {
        System.out.println(S.matches("(dream(er)?|eraser?)+") ? "YES" : "NO");
    }
}

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

        new Solver(in).solve();

        in.close();
    }
}