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