import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        boolean ok = s.matches("(dream(er)?|eraser?|)+");
        System.out.println(ok?"YES":"NO");
    }
} import java.util.*; util.* java class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        boolean ok = s.matches("(dream(er)?|eraser?|)+");
        System.out.println(ok?"YES":"NO");
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        boolean ok = s.matches("(dream(er)?|eraser?|)+");
        System.out.println(ok?"YES":"NO");
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        boolean ok = s.matches("(dream(er)?|eraser?|)+");
        System.out.println(ok?"YES":"NO");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc boolean ok = s.matches("(dream(er)?|eraser?|)+"); ok s.matches("(dream(er)?|eraser?|)+") s.matches s "(dream(er)?|eraser?|)+" System.out.println(ok?"YES":"NO") System.out.println System.out System System.out ok?"YES":"NO" ok "YES" "NO" String[] args args
import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        boolean ok = s.matches("(dream(er)?|eraser?|)+");
        System.out.println(ok?"YES":"NO");
    }
}
