import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    
    String S = sc.next();

    sc.close();

    StringBuffer sb =new StringBuffer(S);

    String R = sb.reverse().toString();

    R = R.replaceAll("resare", "");
    R = R.replaceAll("esare", "");
    R = R.replaceAll("remaerd", "");
    R = R.replaceAll("maerd", "");

    if (R.equals("")) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }

  }

} import java.util.*; util.* java public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    
    String S = sc.next();

    sc.close();

    StringBuffer sb =new StringBuffer(S);

    String R = sb.reverse().toString();

    R = R.replaceAll("resare", "");
    R = R.replaceAll("esare", "");
    R = R.replaceAll("remaerd", "");
    R = R.replaceAll("maerd", "");

    if (R.equals("")) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }

  }

} Main public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    
    String S = sc.next();

    sc.close();

    StringBuffer sb =new StringBuffer(S);

    String R = sb.reverse().toString();

    R = R.replaceAll("resare", "");
    R = R.replaceAll("esare", "");
    R = R.replaceAll("remaerd", "");
    R = R.replaceAll("maerd", "");

    if (R.equals("")) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }

  } main {

    Scanner sc = new Scanner(System.in);
    
    String S = sc.next();

    sc.close();

    StringBuffer sb =new StringBuffer(S);

    String R = sb.reverse().toString();

    R = R.replaceAll("resare", "");
    R = R.replaceAll("esare", "");
    R = R.replaceAll("remaerd", "");
    R = R.replaceAll("maerd", "");

    if (R.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 sc.close() sc.close sc StringBuffer sb =new StringBuffer(S); sb new StringBuffer(S) String R = sb.reverse().toString(); R sb.reverse().toString() sb.reverse().toString sb.reverse() sb.reverse sb R = R.replaceAll("resare", "") R R.replaceAll("resare", "") R.replaceAll R "resare" "" R = R.replaceAll("esare", "") R R.replaceAll("esare", "") R.replaceAll R "esare" "" R = R.replaceAll("remaerd", "") R R.replaceAll("remaerd", "") R.replaceAll R "remaerd" "" R = R.replaceAll("maerd", "") R R.replaceAll("maerd", "") R.replaceAll R "maerd" "" if (R.equals("")) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    } R.equals("") R.equals R "" {
      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 public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    
    String S = sc.next();

    sc.close();

    StringBuffer sb =new StringBuffer(S);

    String R = sb.reverse().toString();

    R = R.replaceAll("resare", "");
    R = R.replaceAll("esare", "");
    R = R.replaceAll("remaerd", "");
    R = R.replaceAll("maerd", "");

    if (R.equals("")) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }

  }

} public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    
    String S = sc.next();

    sc.close();

    StringBuffer sb =new StringBuffer(S);

    String R = sb.reverse().toString();

    R = R.replaceAll("resare", "");
    R = R.replaceAll("esare", "");
    R = R.replaceAll("remaerd", "");
    R = R.replaceAll("maerd", "");

    if (R.equals("")) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }

  }

} Main
import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    
    String S = sc.next();

    sc.close();

    StringBuffer sb =new StringBuffer(S);

    String R = sb.reverse().toString();

    R = R.replaceAll("resare", "");
    R = R.replaceAll("esare", "");
    R = R.replaceAll("remaerd", "");
    R = R.replaceAll("maerd", "");

    if (R.equals("")) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }

  }

}