import java.util.Scanner;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String ans;

    s = s.replaceAll("eraser", "-");
    s = s.replaceAll("erase", "-");
    s = s.replaceAll("dreamer", "-");
    s = s.replaceAll("dream", "-");
    s = s.replaceAll("-", "");
    
    if (s.length() == 0) {
      ans = "YES";
    } else {
      ans = "NO";
    }
    System.out.println(ans);
    sc.close();
    return;
  }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String ans;

    s = s.replaceAll("eraser", "-");
    s = s.replaceAll("erase", "-");
    s = s.replaceAll("dreamer", "-");
    s = s.replaceAll("dream", "-");
    s = s.replaceAll("-", "");
    
    if (s.length() == 0) {
      ans = "YES";
    } else {
      ans = "NO";
    }
    System.out.println(ans);
    sc.close();
    return;
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String ans;

    s = s.replaceAll("eraser", "-");
    s = s.replaceAll("erase", "-");
    s = s.replaceAll("dreamer", "-");
    s = s.replaceAll("dream", "-");
    s = s.replaceAll("-", "");
    
    if (s.length() == 0) {
      ans = "YES";
    } else {
      ans = "NO";
    }
    System.out.println(ans);
    sc.close();
    return;
  } main {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String ans;

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

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

    s = s.replaceAll("eraser", "-");
    s = s.replaceAll("erase", "-");
    s = s.replaceAll("dreamer", "-");
    s = s.replaceAll("dream", "-");
    s = s.replaceAll("-", "");
    
    if (s.length() == 0) {
      ans = "YES";
    } else {
      ans = "NO";
    }
    System.out.println(ans);
    sc.close();
    return;
  }
} Main
import java.util.Scanner;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String ans;

    s = s.replaceAll("eraser", "-");
    s = s.replaceAll("erase", "-");
    s = s.replaceAll("dreamer", "-");
    s = s.replaceAll("dream", "-");
    s = s.replaceAll("-", "");
    
    if (s.length() == 0) {
      ans = "YES";
    } else {
      ans = "NO";
    }
    System.out.println(ans);
    sc.close();
    return;
  }
}