import java.util.*;
public class Main{
  public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
    String str=sc.next();
    if(str.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","").equals("")){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }

	}
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
    String str=sc.next();
    if(str.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","").equals("")){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }

	}
} Main public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
    String str=sc.next();
    if(str.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","").equals("")){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }

	} main {
	Scanner sc=new Scanner(System.in);
    String str=sc.next();
    if(str.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","").equals("")){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }

	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) String str=sc.next(); str sc.next() sc.next sc if(str.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","").equals("")){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    } str.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","").equals("") str.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","").equals str.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","") str.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll str.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","") str.replaceAll("eraser","").replaceAll("erase","").replaceAll str.replaceAll("eraser","").replaceAll("erase","") str.replaceAll("eraser","").replaceAll str.replaceAll("eraser","") str.replaceAll str "eraser" "" "erase" "" "dreamer" "" "dream" "" "" {
      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 public class Main{
  public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
    String str=sc.next();
    if(str.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","").equals("")){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }

	}
} public class Main{
  public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
    String str=sc.next();
    if(str.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","").equals("")){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }

	}
} Main
import java.util.*;
public class Main{
  public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
    String str=sc.next();
    if(str.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","").equals("")){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }

	}
}