import java.util.*;
import java.io.*;
public class Main {
	public static void main(String[] args){
	  Scanner sc = new Scanner(System.in);
      String str = sc.nextLine();
      str = str.replaceAll("eraser", " ");
      str = str.replaceAll("erase", " ");
      str = str.replaceAll("dreamer", " ");
      str = str.replaceAll("dream", " ");
      int strNum = str.split(" ").length;
      if(strNum>0){
        System.out.println("NO");
      } else {
        System.out.println("YES");
      } 
	}
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
	public static void main(String[] args){
	  Scanner sc = new Scanner(System.in);
      String str = sc.nextLine();
      str = str.replaceAll("eraser", " ");
      str = str.replaceAll("erase", " ");
      str = str.replaceAll("dreamer", " ");
      str = str.replaceAll("dream", " ");
      int strNum = str.split(" ").length;
      if(strNum>0){
        System.out.println("NO");
      } else {
        System.out.println("YES");
      } 
	}
} Main public static void main(String[] args){
	  Scanner sc = new Scanner(System.in);
      String str = sc.nextLine();
      str = str.replaceAll("eraser", " ");
      str = str.replaceAll("erase", " ");
      str = str.replaceAll("dreamer", " ");
      str = str.replaceAll("dream", " ");
      int strNum = str.split(" ").length;
      if(strNum>0){
        System.out.println("NO");
      } else {
        System.out.println("YES");
      } 
	} main {
	  Scanner sc = new Scanner(System.in);
      String str = sc.nextLine();
      str = str.replaceAll("eraser", " ");
      str = str.replaceAll("erase", " ");
      str = str.replaceAll("dreamer", " ");
      str = str.replaceAll("dream", " ");
      int strNum = str.split(" ").length;
      if(strNum>0){
        System.out.println("NO");
      } else {
        System.out.println("YES");
      } 
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.nextLine(); str sc.nextLine() sc.nextLine sc str = str.replaceAll("eraser", " ") str str.replaceAll("eraser", " ") str.replaceAll str "eraser" " " str = str.replaceAll("erase", " ") str str.replaceAll("erase", " ") str.replaceAll str "erase" " " str = str.replaceAll("dreamer", " ") str str.replaceAll("dreamer", " ") str.replaceAll str "dreamer" " " str = str.replaceAll("dream", " ") str str.replaceAll("dream", " ") str.replaceAll str "dream" " " int strNum = str.split(" ").length; strNum str.split(" ").length str.split(" ") str.split str " " str.split(" ").length if(strNum>0){
        System.out.println("NO");
      } else {
        System.out.println("YES");
      } strNum>0 strNum 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 class Main {
	public static void main(String[] args){
	  Scanner sc = new Scanner(System.in);
      String str = sc.nextLine();
      str = str.replaceAll("eraser", " ");
      str = str.replaceAll("erase", " ");
      str = str.replaceAll("dreamer", " ");
      str = str.replaceAll("dream", " ");
      int strNum = str.split(" ").length;
      if(strNum>0){
        System.out.println("NO");
      } else {
        System.out.println("YES");
      } 
	}
} public class Main {
	public static void main(String[] args){
	  Scanner sc = new Scanner(System.in);
      String str = sc.nextLine();
      str = str.replaceAll("eraser", " ");
      str = str.replaceAll("erase", " ");
      str = str.replaceAll("dreamer", " ");
      str = str.replaceAll("dream", " ");
      int strNum = str.split(" ").length;
      if(strNum>0){
        System.out.println("NO");
      } else {
        System.out.println("YES");
      } 
	}
} Main
import java.util.*;
import java.io.*;
public class Main {
	public static void main(String[] args){
	  Scanner sc = new Scanner(System.in);
      String str = sc.nextLine();
      str = str.replaceAll("eraser", " ");
      str = str.replaceAll("erase", " ");
      str = str.replaceAll("dreamer", " ");
      str = str.replaceAll("dream", " ");
      int strNum = str.split(" ").length;
      if(strNum>0){
        System.out.println("NO");
      } else {
        System.out.println("YES");
      } 
	}
}