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

class Main {
    public static void main(String args[]) throws IOException{
        BufferedReader buff = null;
        buff = new BufferedReader(new InputStreamReader(System.in));
        String s = buff.readLine();
        s = s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","");
        if(s.equals("")){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main {
    public static void main(String args[]) throws IOException{
        BufferedReader buff = null;
        buff = new BufferedReader(new InputStreamReader(System.in));
        String s = buff.readLine();
        s = s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","");
        if(s.equals("")){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }
} Main public static void main(String args[]) throws IOException{
        BufferedReader buff = null;
        buff = new BufferedReader(new InputStreamReader(System.in));
        String s = buff.readLine();
        s = s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","");
        if(s.equals("")){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    } main {
        BufferedReader buff = null;
        buff = new BufferedReader(new InputStreamReader(System.in));
        String s = buff.readLine();
        s = s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","");
        if(s.equals("")){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    } BufferedReader buff = null; buff null buff = new BufferedReader(new InputStreamReader(System.in)) buff new BufferedReader(new InputStreamReader(System.in)) String s = buff.readLine(); s buff.readLine() buff.readLine buff s = s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","") s s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","") s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","") s.replaceAll("eraser","").replaceAll("erase","").replaceAll s.replaceAll("eraser","").replaceAll("erase","") s.replaceAll("eraser","").replaceAll s.replaceAll("eraser","") s.replaceAll s "eraser" "" "erase" "" "dreamer" "" "dream" "" if(s.equals("")){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        } s.equals("") s.equals s "" {
            System.out.println("YES");
        } System.out.println("YES") System.out.println System.out System System.out "YES" {
            System.out.println("NO");
        } System.out.println("NO") System.out.println System.out System System.out "NO" String args[] args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
    public static void main(String args[]) throws IOException{
        BufferedReader buff = null;
        buff = new BufferedReader(new InputStreamReader(System.in));
        String s = buff.readLine();
        s = s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","");
        if(s.equals("")){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }
}