import java.util.*;
public class Main{   
    public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String s = sc.next();
      if(s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","").equals(""))System.out.println("YES");
      else System.out.println("NO");
    }
    public static int lcm(int x, int y){
      return x*y/gcd(x,y);
    }
    public static int gcd(int x, int y){
      if(x < y)return gcd(y,x);
      if(y==0)return x;
      return gcd(y,x%y);
    }
} import java.util.*; util.* java public class Main{   
    public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String s = sc.next();
      if(s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","").equals(""))System.out.println("YES");
      else System.out.println("NO");
    }
    public static int lcm(int x, int y){
      return x*y/gcd(x,y);
    }
    public static int gcd(int x, int y){
      if(x < y)return gcd(y,x);
      if(y==0)return x;
      return gcd(y,x%y);
    }
} Main public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String s = sc.next();
      if(s.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 s = sc.next();
      if(s.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 s = sc.next(); s sc.next() sc.next sc if(s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","").equals(""))System.out.println("YES");
      else System.out.println("NO"); s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","").equals("") s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","").equals 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" "" "" System.out.println("YES") System.out.println System.out System System.out "YES" System.out.println("NO") System.out.println System.out System System.out "NO" String[] args args public static int lcm(int x, int y){
      return x*y/gcd(x,y);
    } lcm {
      return x*y/gcd(x,y);
    } return x*y/gcd(x,y); x*y/gcd(x,y) x*y x y gcd(x,y) gcd x y int x x int y y public static int gcd(int x, int y){
      if(x < y)return gcd(y,x);
      if(y==0)return x;
      return gcd(y,x%y);
    } gcd {
      if(x < y)return gcd(y,x);
      if(y==0)return x;
      return gcd(y,x%y);
    } if(x < y)return gcd(y,x); x < y x y return gcd(y,x); gcd(y,x) gcd y x if(y==0)return x; y==0 y 0 return x; x return gcd(y,x%y); gcd(y,x%y) gcd y x%y x y int x x int y y public class Main{   
    public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String s = sc.next();
      if(s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","").equals(""))System.out.println("YES");
      else System.out.println("NO");
    }
    public static int lcm(int x, int y){
      return x*y/gcd(x,y);
    }
    public static int gcd(int x, int y){
      if(x < y)return gcd(y,x);
      if(y==0)return x;
      return gcd(y,x%y);
    }
} public class Main{   
    public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String s = sc.next();
      if(s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","").equals(""))System.out.println("YES");
      else System.out.println("NO");
    }
    public static int lcm(int x, int y){
      return x*y/gcd(x,y);
    }
    public static int gcd(int x, int y){
      if(x < y)return gcd(y,x);
      if(y==0)return x;
      return gcd(y,x%y);
    }
} Main
import java.util.*;
public class Main{   
    public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String s = sc.next();
      if(s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","").equals(""))System.out.println("YES");
      else System.out.println("NO");
    }
    public static int lcm(int x, int y){
      return x*y/gcd(x,y);
    }
    public static int gcd(int x, int y){
      if(x < y)return gcd(y,x);
      if(y==0)return x;
      return gcd(y,x%y);
    }
}