import java.util.*;

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

    String[] s = new String[1];
    s[0] = sc.next();
    s[0] = "1" + s[0];

    String[] a = {"dream", "dreamer", "erase", "eraser"};

    s[0] = rep(s, a[3]);
    s[0] = rep(s, a[2]);
    s[0] = rep(s, a[1]);
    s[0] = rep(s, a[0]);

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

  }

  public static String rep (String[] s, String a) {
    boolean ok = true;
    while (ok) {
      int n = s[0].indexOf(a);
      if (n == -1) {
        ok = false;
      } else {
        s[0] = s[0].replaceAll(a, "");
      }
    }
    return s[0];
  }
  
} import java.util.*; util.* java public class Main {
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);

    String[] s = new String[1];
    s[0] = sc.next();
    s[0] = "1" + s[0];

    String[] a = {"dream", "dreamer", "erase", "eraser"};

    s[0] = rep(s, a[3]);
    s[0] = rep(s, a[2]);
    s[0] = rep(s, a[1]);
    s[0] = rep(s, a[0]);

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

  }

  public static String rep (String[] s, String a) {
    boolean ok = true;
    while (ok) {
      int n = s[0].indexOf(a);
      if (n == -1) {
        ok = false;
      } else {
        s[0] = s[0].replaceAll(a, "");
      }
    }
    return s[0];
  }
  
} Main public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);

    String[] s = new String[1];
    s[0] = sc.next();
    s[0] = "1" + s[0];

    String[] a = {"dream", "dreamer", "erase", "eraser"};

    s[0] = rep(s, a[3]);
    s[0] = rep(s, a[2]);
    s[0] = rep(s, a[1]);
    s[0] = rep(s, a[0]);

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

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

    String[] s = new String[1];
    s[0] = sc.next();
    s[0] = "1" + s[0];

    String[] a = {"dream", "dreamer", "erase", "eraser"};

    s[0] = rep(s, a[3]);
    s[0] = rep(s, a[2]);
    s[0] = rep(s, a[1]);
    s[0] = rep(s, a[0]);

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

  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] s = new String[1]; s new String[1] 1 s[0] = sc.next() s[0] s 0 sc.next() sc.next sc s[0] = "1" + s[0] s[0] s 0 "1" + s[0] "1" s[0] s 0 String[] a = {"dream", "dreamer", "erase", "eraser"}; a {"dream", "dreamer", "erase", "eraser"} "dream" "dreamer" "erase" "eraser" s[0] = rep(s, a[3]) s[0] s 0 rep(s, a[3]) rep s a[3] a 3 s[0] = rep(s, a[2]) s[0] s 0 rep(s, a[2]) rep s a[2] a 2 s[0] = rep(s, a[1]) s[0] s 0 rep(s, a[1]) rep s a[1] a 1 s[0] = rep(s, a[0]) s[0] s 0 rep(s, a[0]) rep s a[0] a 0 System.out.println(s[0].equals("1") ? "YES" : "NO") System.out.println System.out System System.out s[0].equals("1") ? "YES" : "NO" s[0].equals("1") s[0].equals s[0] s 0 "1" "YES" "NO" String[] args args public static String rep (String[] s, String a) {
    boolean ok = true;
    while (ok) {
      int n = s[0].indexOf(a);
      if (n == -1) {
        ok = false;
      } else {
        s[0] = s[0].replaceAll(a, "");
      }
    }
    return s[0];
  } rep {
    boolean ok = true;
    while (ok) {
      int n = s[0].indexOf(a);
      if (n == -1) {
        ok = false;
      } else {
        s[0] = s[0].replaceAll(a, "");
      }
    }
    return s[0];
  } boolean ok = true; ok true while (ok) {
      int n = s[0].indexOf(a);
      if (n == -1) {
        ok = false;
      } else {
        s[0] = s[0].replaceAll(a, "");
      }
    } ok {
      int n = s[0].indexOf(a);
      if (n == -1) {
        ok = false;
      } else {
        s[0] = s[0].replaceAll(a, "");
      }
    } int n = s[0].indexOf(a); n s[0].indexOf(a) s[0].indexOf s[0] s 0 a if (n == -1) {
        ok = false;
      } else {
        s[0] = s[0].replaceAll(a, "");
      } n == -1 n -1 1 {
        ok = false;
      } ok = false ok false {
        s[0] = s[0].replaceAll(a, "");
      } s[0] = s[0].replaceAll(a, "") s[0] s 0 s[0].replaceAll(a, "") s[0].replaceAll s[0] s 0 a "" return s[0]; s[0] s 0 String[] s s String a a public class Main {
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);

    String[] s = new String[1];
    s[0] = sc.next();
    s[0] = "1" + s[0];

    String[] a = {"dream", "dreamer", "erase", "eraser"};

    s[0] = rep(s, a[3]);
    s[0] = rep(s, a[2]);
    s[0] = rep(s, a[1]);
    s[0] = rep(s, a[0]);

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

  }

  public static String rep (String[] s, String a) {
    boolean ok = true;
    while (ok) {
      int n = s[0].indexOf(a);
      if (n == -1) {
        ok = false;
      } else {
        s[0] = s[0].replaceAll(a, "");
      }
    }
    return s[0];
  }
  
} public class Main {
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);

    String[] s = new String[1];
    s[0] = sc.next();
    s[0] = "1" + s[0];

    String[] a = {"dream", "dreamer", "erase", "eraser"};

    s[0] = rep(s, a[3]);
    s[0] = rep(s, a[2]);
    s[0] = rep(s, a[1]);
    s[0] = rep(s, a[0]);

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

  }

  public static String rep (String[] s, String a) {
    boolean ok = true;
    while (ok) {
      int n = s[0].indexOf(a);
      if (n == -1) {
        ok = false;
      } else {
        s[0] = s[0].replaceAll(a, "");
      }
    }
    return s[0];
  }
  
} Main
import java.util.*;

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

    String[] s = new String[1];
    s[0] = sc.next();
    s[0] = "1" + s[0];

    String[] a = {"dream", "dreamer", "erase", "eraser"};

    s[0] = rep(s, a[3]);
    s[0] = rep(s, a[2]);
    s[0] = rep(s, a[1]);
    s[0] = rep(s, a[0]);

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

  }

  public static String rep (String[] s, String a) {
    boolean ok = true;
    while (ok) {
      int n = s[0].indexOf(a);
      if (n == -1) {
        ok = false;
      } else {
        s[0] = s[0].replaceAll(a, "");
      }
    }
    return s[0];
  }
  
}