import java.util.Scanner;

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

    String s = scanner.next();
    if (possible(s)) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
  }

  private static boolean possible(CharSequence s) {
    for (int i = 0; i < s.length();) {
      if (startsWith(s, i, "dreamer")) {
        i += 5;
        if (!startsWith(s, i, "erase")) i += 2;
      } else if (startsWith(s, i, "dream")) {
        i += 5;
      } else if (startsWith(s, i, "eraser")) {
        i += 6;
      } else if (startsWith(s, i, "erase")) {
        i += 5;
      } else {
        return false;
      }
    }
    return true;
  }

  private static boolean startsWith(CharSequence s, int i, String t) {
    if (i + t.length() > s.length()) return false;
    for (int j = 0; j < t.length(); j++) {
      if (s.charAt(i + j) != t.charAt(j)) return false;
    }
    return true;
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    String s = scanner.next();
    if (possible(s)) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
  }

  private static boolean possible(CharSequence s) {
    for (int i = 0; i < s.length();) {
      if (startsWith(s, i, "dreamer")) {
        i += 5;
        if (!startsWith(s, i, "erase")) i += 2;
      } else if (startsWith(s, i, "dream")) {
        i += 5;
      } else if (startsWith(s, i, "eraser")) {
        i += 6;
      } else if (startsWith(s, i, "erase")) {
        i += 5;
      } else {
        return false;
      }
    }
    return true;
  }

  private static boolean startsWith(CharSequence s, int i, String t) {
    if (i + t.length() > s.length()) return false;
    for (int j = 0; j < t.length(); j++) {
      if (s.charAt(i + j) != t.charAt(j)) return false;
    }
    return true;
  }
} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    String s = scanner.next();
    if (possible(s)) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
  } main {
    Scanner scanner = new Scanner(System.in);

    String s = scanner.next();
    if (possible(s)) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String s = scanner.next(); s scanner.next() scanner.next scanner if (possible(s)) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    } possible(s) possible s {
      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 private static boolean possible(CharSequence s) {
    for (int i = 0; i < s.length();) {
      if (startsWith(s, i, "dreamer")) {
        i += 5;
        if (!startsWith(s, i, "erase")) i += 2;
      } else if (startsWith(s, i, "dream")) {
        i += 5;
      } else if (startsWith(s, i, "eraser")) {
        i += 6;
      } else if (startsWith(s, i, "erase")) {
        i += 5;
      } else {
        return false;
      }
    }
    return true;
  } possible {
    for (int i = 0; i < s.length();) {
      if (startsWith(s, i, "dreamer")) {
        i += 5;
        if (!startsWith(s, i, "erase")) i += 2;
      } else if (startsWith(s, i, "dream")) {
        i += 5;
      } else if (startsWith(s, i, "eraser")) {
        i += 6;
      } else if (startsWith(s, i, "erase")) {
        i += 5;
      } else {
        return false;
      }
    }
    return true;
  } for (int i = 0; i < s.length();) {
      if (startsWith(s, i, "dreamer")) {
        i += 5;
        if (!startsWith(s, i, "erase")) i += 2;
      } else if (startsWith(s, i, "dream")) {
        i += 5;
      } else if (startsWith(s, i, "eraser")) {
        i += 6;
      } else if (startsWith(s, i, "erase")) {
        i += 5;
      } else {
        return false;
      }
    } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s {
      if (startsWith(s, i, "dreamer")) {
        i += 5;
        if (!startsWith(s, i, "erase")) i += 2;
      } else if (startsWith(s, i, "dream")) {
        i += 5;
      } else if (startsWith(s, i, "eraser")) {
        i += 6;
      } else if (startsWith(s, i, "erase")) {
        i += 5;
      } else {
        return false;
      }
    } {
      if (startsWith(s, i, "dreamer")) {
        i += 5;
        if (!startsWith(s, i, "erase")) i += 2;
      } else if (startsWith(s, i, "dream")) {
        i += 5;
      } else if (startsWith(s, i, "eraser")) {
        i += 6;
      } else if (startsWith(s, i, "erase")) {
        i += 5;
      } else {
        return false;
      }
    } if (startsWith(s, i, "dreamer")) {
        i += 5;
        if (!startsWith(s, i, "erase")) i += 2;
      } else if (startsWith(s, i, "dream")) {
        i += 5;
      } else if (startsWith(s, i, "eraser")) {
        i += 6;
      } else if (startsWith(s, i, "erase")) {
        i += 5;
      } else {
        return false;
      } startsWith(s, i, "dreamer") startsWith s i "dreamer" {
        i += 5;
        if (!startsWith(s, i, "erase")) i += 2;
      } i += 5 i 5 if (!startsWith(s, i, "erase")) i += 2; !startsWith(s, i, "erase") startsWith(s, i, "erase") startsWith s i "erase" i += 2 i 2 if (startsWith(s, i, "dream")) {
        i += 5;
      } else if (startsWith(s, i, "eraser")) {
        i += 6;
      } else if (startsWith(s, i, "erase")) {
        i += 5;
      } else {
        return false;
      } startsWith(s, i, "dream") startsWith s i "dream" {
        i += 5;
      } i += 5 i 5 if (startsWith(s, i, "eraser")) {
        i += 6;
      } else if (startsWith(s, i, "erase")) {
        i += 5;
      } else {
        return false;
      } startsWith(s, i, "eraser") startsWith s i "eraser" {
        i += 6;
      } i += 6 i 6 if (startsWith(s, i, "erase")) {
        i += 5;
      } else {
        return false;
      } startsWith(s, i, "erase") startsWith s i "erase" {
        i += 5;
      } i += 5 i 5 {
        return false;
      } return false; false return true; true CharSequence s s private static boolean startsWith(CharSequence s, int i, String t) {
    if (i + t.length() > s.length()) return false;
    for (int j = 0; j < t.length(); j++) {
      if (s.charAt(i + j) != t.charAt(j)) return false;
    }
    return true;
  } startsWith {
    if (i + t.length() > s.length()) return false;
    for (int j = 0; j < t.length(); j++) {
      if (s.charAt(i + j) != t.charAt(j)) return false;
    }
    return true;
  } if (i + t.length() > s.length()) return false; i + t.length() > s.length() i + t.length() i t.length() t.length t s.length() s.length s return false; false for (int j = 0; j < t.length(); j++) {
      if (s.charAt(i + j) != t.charAt(j)) return false;
    } int j = 0; int j = 0; j 0 j < t.length() j t.length() t.length t j++ j++ j {
      if (s.charAt(i + j) != t.charAt(j)) return false;
    } {
      if (s.charAt(i + j) != t.charAt(j)) return false;
    } if (s.charAt(i + j) != t.charAt(j)) return false; s.charAt(i + j) != t.charAt(j) s.charAt(i + j) s.charAt s i + j i j t.charAt(j) t.charAt t j return false; false return true; true CharSequence s s int i i String t t public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    String s = scanner.next();
    if (possible(s)) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
  }

  private static boolean possible(CharSequence s) {
    for (int i = 0; i < s.length();) {
      if (startsWith(s, i, "dreamer")) {
        i += 5;
        if (!startsWith(s, i, "erase")) i += 2;
      } else if (startsWith(s, i, "dream")) {
        i += 5;
      } else if (startsWith(s, i, "eraser")) {
        i += 6;
      } else if (startsWith(s, i, "erase")) {
        i += 5;
      } else {
        return false;
      }
    }
    return true;
  }

  private static boolean startsWith(CharSequence s, int i, String t) {
    if (i + t.length() > s.length()) return false;
    for (int j = 0; j < t.length(); j++) {
      if (s.charAt(i + j) != t.charAt(j)) return false;
    }
    return true;
  }
} public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    String s = scanner.next();
    if (possible(s)) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
  }

  private static boolean possible(CharSequence s) {
    for (int i = 0; i < s.length();) {
      if (startsWith(s, i, "dreamer")) {
        i += 5;
        if (!startsWith(s, i, "erase")) i += 2;
      } else if (startsWith(s, i, "dream")) {
        i += 5;
      } else if (startsWith(s, i, "eraser")) {
        i += 6;
      } else if (startsWith(s, i, "erase")) {
        i += 5;
      } else {
        return false;
      }
    }
    return true;
  }

  private static boolean startsWith(CharSequence s, int i, String t) {
    if (i + t.length() > s.length()) return false;
    for (int j = 0; j < t.length(); j++) {
      if (s.charAt(i + j) != t.charAt(j)) return false;
    }
    return true;
  }
} Main
import java.util.Scanner;

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

    String s = scanner.next();
    if (possible(s)) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
  }

  private static boolean possible(CharSequence s) {
    for (int i = 0; i < s.length();) {
      if (startsWith(s, i, "dreamer")) {
        i += 5;
        if (!startsWith(s, i, "erase")) i += 2;
      } else if (startsWith(s, i, "dream")) {
        i += 5;
      } else if (startsWith(s, i, "eraser")) {
        i += 6;
      } else if (startsWith(s, i, "erase")) {
        i += 5;
      } else {
        return false;
      }
    }
    return true;
  }

  private static boolean startsWith(CharSequence s, int i, String t) {
    if (i + t.length() > s.length()) return false;
    for (int j = 0; j < t.length(); j++) {
      if (s.charAt(i + j) != t.charAt(j)) return false;
    }
    return true;
  }
}
