import java.util.*;

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

    String s = "1" + sc.next();
    String[] a = {"dream", "dreamer", "erase", "eraser"};

    s = s.replaceAll(a[3], "");
    s = s.replaceAll(a[2], "");
    s = s.replaceAll(a[1], "");
    s = s.replaceAll(a[0], "");

    System.out.println(s.equals("1") ? "YES" : "NO");

  }
} import java.util.*; util.* java public class Main {
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);

    String s = "1" + sc.next();
    String[] a = {"dream", "dreamer", "erase", "eraser"};

    s = s.replaceAll(a[3], "");
    s = s.replaceAll(a[2], "");
    s = s.replaceAll(a[1], "");
    s = s.replaceAll(a[0], "");

    System.out.println(s.equals("1") ? "YES" : "NO");

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

    String s = "1" + sc.next();
    String[] a = {"dream", "dreamer", "erase", "eraser"};

    s = s.replaceAll(a[3], "");
    s = s.replaceAll(a[2], "");
    s = s.replaceAll(a[1], "");
    s = s.replaceAll(a[0], "");

    System.out.println(s.equals("1") ? "YES" : "NO");

  } main {
    Scanner sc = new Scanner(System.in);

    String s = "1" + sc.next();
    String[] a = {"dream", "dreamer", "erase", "eraser"};

    s = s.replaceAll(a[3], "");
    s = s.replaceAll(a[2], "");
    s = s.replaceAll(a[1], "");
    s = s.replaceAll(a[0], "");

    System.out.println(s.equals("1") ? "YES" : "NO");

  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = "1" + sc.next(); s "1" + sc.next() "1" sc.next() sc.next sc String[] a = {"dream", "dreamer", "erase", "eraser"}; a {"dream", "dreamer", "erase", "eraser"} "dream" "dreamer" "erase" "eraser" s = s.replaceAll(a[3], "") s s.replaceAll(a[3], "") s.replaceAll s a[3] a 3 "" s = s.replaceAll(a[2], "") s s.replaceAll(a[2], "") s.replaceAll s a[2] a 2 "" s = s.replaceAll(a[1], "") s s.replaceAll(a[1], "") s.replaceAll s a[1] a 1 "" s = s.replaceAll(a[0], "") s s.replaceAll(a[0], "") s.replaceAll s a[0] a 0 "" System.out.println(s.equals("1") ? "YES" : "NO") System.out.println System.out System System.out s.equals("1") ? "YES" : "NO" s.equals("1") s.equals s "1" "YES" "NO" String[] args args public class Main {
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);

    String s = "1" + sc.next();
    String[] a = {"dream", "dreamer", "erase", "eraser"};

    s = s.replaceAll(a[3], "");
    s = s.replaceAll(a[2], "");
    s = s.replaceAll(a[1], "");
    s = s.replaceAll(a[0], "");

    System.out.println(s.equals("1") ? "YES" : "NO");

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

    String s = "1" + sc.next();
    String[] a = {"dream", "dreamer", "erase", "eraser"};

    s = s.replaceAll(a[3], "");
    s = s.replaceAll(a[2], "");
    s = s.replaceAll(a[1], "");
    s = s.replaceAll(a[0], "");

    System.out.println(s.equals("1") ? "YES" : "NO");

  }
} Main
import java.util.*;

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

    String s = "1" + sc.next();
    String[] a = {"dream", "dreamer", "erase", "eraser"};

    s = s.replaceAll(a[3], "");
    s = s.replaceAll(a[2], "");
    s = s.replaceAll(a[1], "");
    s = s.replaceAll(a[0], "");

    System.out.println(s.equals("1") ? "YES" : "NO");

  }
}