import java.util.Scanner;
public class Main {
  public static void main(String[] args) {
    new Main();
  }
  public Main() {
    try (Scanner sc = new Scanner(System.in)) {
      String S = sc.next();
      StringBuilder rev = new StringBuilder();
      for (int i = S.length() - 1;i >= 0;-- i) {
        rev.append(S.charAt(i));
        switch(rev.toString()) {
          case "maerd":
          case "remaerd":
          case "esare":
          case "resare":
            rev.delete(0, rev.length());
        }
        if (rev.length() >= 8) break;
      }
      System.out.println(rev.length() == 0 ? "YES" : "NO");
    }
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    new Main();
  }
  public Main() {
    try (Scanner sc = new Scanner(System.in)) {
      String S = sc.next();
      StringBuilder rev = new StringBuilder();
      for (int i = S.length() - 1;i >= 0;-- i) {
        rev.append(S.charAt(i));
        switch(rev.toString()) {
          case "maerd":
          case "remaerd":
          case "esare":
          case "resare":
            rev.delete(0, rev.length());
        }
        if (rev.length() >= 8) break;
      }
      System.out.println(rev.length() == 0 ? "YES" : "NO");
    }
  }
} Main public static void main(String[] args) {
    new Main();
  } main {
    new Main();
  } new Main() String[] args args public Main() {
    try (Scanner sc = new Scanner(System.in)) {
      String S = sc.next();
      StringBuilder rev = new StringBuilder();
      for (int i = S.length() - 1;i >= 0;-- i) {
        rev.append(S.charAt(i));
        switch(rev.toString()) {
          case "maerd":
          case "remaerd":
          case "esare":
          case "resare":
            rev.delete(0, rev.length());
        }
        if (rev.length() >= 8) break;
      }
      System.out.println(rev.length() == 0 ? "YES" : "NO");
    }
  } Main {
    try (Scanner sc = new Scanner(System.in)) {
      String S = sc.next();
      StringBuilder rev = new StringBuilder();
      for (int i = S.length() - 1;i >= 0;-- i) {
        rev.append(S.charAt(i));
        switch(rev.toString()) {
          case "maerd":
          case "remaerd":
          case "esare":
          case "resare":
            rev.delete(0, rev.length());
        }
        if (rev.length() >= 8) break;
      }
      System.out.println(rev.length() == 0 ? "YES" : "NO");
    }
  } try (Scanner sc = new Scanner(System.in)) {
      String S = sc.next();
      StringBuilder rev = new StringBuilder();
      for (int i = S.length() - 1;i >= 0;-- i) {
        rev.append(S.charAt(i));
        switch(rev.toString()) {
          case "maerd":
          case "remaerd":
          case "esare":
          case "resare":
            rev.delete(0, rev.length());
        }
        if (rev.length() >= 8) break;
      }
      System.out.println(rev.length() == 0 ? "YES" : "NO");
    } {
      String S = sc.next();
      StringBuilder rev = new StringBuilder();
      for (int i = S.length() - 1;i >= 0;-- i) {
        rev.append(S.charAt(i));
        switch(rev.toString()) {
          case "maerd":
          case "remaerd":
          case "esare":
          case "resare":
            rev.delete(0, rev.length());
        }
        if (rev.length() >= 8) break;
      }
      System.out.println(rev.length() == 0 ? "YES" : "NO");
    } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc StringBuilder rev = new StringBuilder(); rev new StringBuilder() for (int i = S.length() - 1;i >= 0;-- i) {
        rev.append(S.charAt(i));
        switch(rev.toString()) {
          case "maerd":
          case "remaerd":
          case "esare":
          case "resare":
            rev.delete(0, rev.length());
        }
        if (rev.length() >= 8) break;
      } int i = S.length() - 1; int i = S.length() - 1; i S.length() - 1 S.length() S.length S 1 i >= 0 i 0 -- i -- i i {
        rev.append(S.charAt(i));
        switch(rev.toString()) {
          case "maerd":
          case "remaerd":
          case "esare":
          case "resare":
            rev.delete(0, rev.length());
        }
        if (rev.length() >= 8) break;
      } {
        rev.append(S.charAt(i));
        switch(rev.toString()) {
          case "maerd":
          case "remaerd":
          case "esare":
          case "resare":
            rev.delete(0, rev.length());
        }
        if (rev.length() >= 8) break;
      } rev.append(S.charAt(i)) rev.append rev S.charAt(i) S.charAt S i switch(rev.toString()) {
          case "maerd":
          case "remaerd":
          case "esare":
          case "resare":
            rev.delete(0, rev.length());
        } rev.toString() rev.toString rev case "maerd": "maerd" case "maerd": case "remaerd": "remaerd" case "remaerd": case "esare": "esare" case "esare": case "resare": "resare" case "resare": rev.delete(0, rev.length()) rev.delete rev 0 rev.length() rev.length rev if (rev.length() >= 8) break; rev.length() >= 8 rev.length() rev.length rev 8 break; System.out.println(rev.length() == 0 ? "YES" : "NO") System.out.println System.out System System.out rev.length() == 0 ? "YES" : "NO" rev.length() == 0 rev.length() rev.length rev 0 "YES" "NO" public class Main {
  public static void main(String[] args) {
    new Main();
  }
  public Main() {
    try (Scanner sc = new Scanner(System.in)) {
      String S = sc.next();
      StringBuilder rev = new StringBuilder();
      for (int i = S.length() - 1;i >= 0;-- i) {
        rev.append(S.charAt(i));
        switch(rev.toString()) {
          case "maerd":
          case "remaerd":
          case "esare":
          case "resare":
            rev.delete(0, rev.length());
        }
        if (rev.length() >= 8) break;
      }
      System.out.println(rev.length() == 0 ? "YES" : "NO");
    }
  }
} public class Main {
  public static void main(String[] args) {
    new Main();
  }
  public Main() {
    try (Scanner sc = new Scanner(System.in)) {
      String S = sc.next();
      StringBuilder rev = new StringBuilder();
      for (int i = S.length() - 1;i >= 0;-- i) {
        rev.append(S.charAt(i));
        switch(rev.toString()) {
          case "maerd":
          case "remaerd":
          case "esare":
          case "resare":
            rev.delete(0, rev.length());
        }
        if (rev.length() >= 8) break;
      }
      System.out.println(rev.length() == 0 ? "YES" : "NO");
    }
  }
} Main
import java.util.Scanner;
public class Main {
  public static void main(String[] args) {
    new Main();
  }
  public Main() {
    try (Scanner sc = new Scanner(System.in)) {
      String S = sc.next();
      StringBuilder rev = new StringBuilder();
      for (int i = S.length() - 1;i >= 0;-- i) {
        rev.append(S.charAt(i));
        switch(rev.toString()) {
          case "maerd":
          case "remaerd":
          case "esare":
          case "resare":
            rev.delete(0, rev.length());
        }
        if (rev.length() >= 8) break;
      }
      System.out.println(rev.length() == 0 ? "YES" : "NO");
    }
  }
}
