import java.io.*;
import java.util.*;

public class Main {
  private static boolean debug = false;
  private static boolean elapsed = false;

  private static PrintWriter _err = new PrintWriter(System.err);

  private String[] keys = {
    "dreameraser", "dreamerase", "dreamer", "dream", "eraser", "erase"
  };

  private void solve(Scanner sc, PrintWriter out) {
    String S = sc.nextLine();

    int i = 0;
    while (i < S.length()) {
      boolean found = false;
      for (int j = 0; j < keys.length; ++j) {
        int keylen = keys[j].length();
        if (i + keylen <= S.length()) {
          String s = S.substring(i, i + keylen);
          if (s.equals(keys[j])) {
            i += keylen;
            found = true;
            break;
          }
        }
      }
      if (!found) {
        break;
      }
    }
    out.println((i == S.length() ? "YES" : "NO"));
  }
  private long C(long n, long r) {
    long res = 1;
    for (long i = n; i > n - r; --i) {
      res *= i;
    }
    for (long i = r; i > 1; --i) {
      res /= i;
    }
    return res;
  }
  private long P(long n, long r) {
    long res = 1;
    for (long i = n; i > n - r; --i) {
      res *= i;
    }
    return res;
  }
  private long ceil2pow(long n) {
    if (n == 0) {
      return 1;
    }
    n--;
    n |= (n >>> 1);
    n |= (n >>> 2);
    n |= (n >>> 4);
    n |= (n >>> 8);
    n |= (n >>> 16);
    n++;
    return n;
  }
  /*
   * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
   * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
   */
  public static void main(String[] args) {
    long S = System.currentTimeMillis();

    Scanner sc = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
    new Main().solve(sc, out);
    out.flush();

    long G = System.currentTimeMillis();
    if (elapsed) {
      _err.println((G - S) + "ms");
    }
    _err.flush();
  }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
  private static boolean debug = false;
  private static boolean elapsed = false;

  private static PrintWriter _err = new PrintWriter(System.err);

  private String[] keys = {
    "dreameraser", "dreamerase", "dreamer", "dream", "eraser", "erase"
  };

  private void solve(Scanner sc, PrintWriter out) {
    String S = sc.nextLine();

    int i = 0;
    while (i < S.length()) {
      boolean found = false;
      for (int j = 0; j < keys.length; ++j) {
        int keylen = keys[j].length();
        if (i + keylen <= S.length()) {
          String s = S.substring(i, i + keylen);
          if (s.equals(keys[j])) {
            i += keylen;
            found = true;
            break;
          }
        }
      }
      if (!found) {
        break;
      }
    }
    out.println((i == S.length() ? "YES" : "NO"));
  }
  private long C(long n, long r) {
    long res = 1;
    for (long i = n; i > n - r; --i) {
      res *= i;
    }
    for (long i = r; i > 1; --i) {
      res /= i;
    }
    return res;
  }
  private long P(long n, long r) {
    long res = 1;
    for (long i = n; i > n - r; --i) {
      res *= i;
    }
    return res;
  }
  private long ceil2pow(long n) {
    if (n == 0) {
      return 1;
    }
    n--;
    n |= (n >>> 1);
    n |= (n >>> 2);
    n |= (n >>> 4);
    n |= (n >>> 8);
    n |= (n >>> 16);
    n++;
    return n;
  }
  /*
   * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
   * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
   */
  public static void main(String[] args) {
    long S = System.currentTimeMillis();

    Scanner sc = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
    new Main().solve(sc, out);
    out.flush();

    long G = System.currentTimeMillis();
    if (elapsed) {
      _err.println((G - S) + "ms");
    }
    _err.flush();
  }
} Main private static boolean debug = false; debug false private static boolean elapsed = false; elapsed false private static PrintWriter _err = new PrintWriter(System.err); _err new PrintWriter(System.err) private String[] keys = {
    "dreameraser", "dreamerase", "dreamer", "dream", "eraser", "erase"
  }; keys {
    "dreameraser", "dreamerase", "dreamer", "dream", "eraser", "erase"
  } "dreameraser" "dreamerase" "dreamer" "dream" "eraser" "erase" private void solve(Scanner sc, PrintWriter out) {
    String S = sc.nextLine();

    int i = 0;
    while (i < S.length()) {
      boolean found = false;
      for (int j = 0; j < keys.length; ++j) {
        int keylen = keys[j].length();
        if (i + keylen <= S.length()) {
          String s = S.substring(i, i + keylen);
          if (s.equals(keys[j])) {
            i += keylen;
            found = true;
            break;
          }
        }
      }
      if (!found) {
        break;
      }
    }
    out.println((i == S.length() ? "YES" : "NO"));
  } solve {
    String S = sc.nextLine();

    int i = 0;
    while (i < S.length()) {
      boolean found = false;
      for (int j = 0; j < keys.length; ++j) {
        int keylen = keys[j].length();
        if (i + keylen <= S.length()) {
          String s = S.substring(i, i + keylen);
          if (s.equals(keys[j])) {
            i += keylen;
            found = true;
            break;
          }
        }
      }
      if (!found) {
        break;
      }
    }
    out.println((i == S.length() ? "YES" : "NO"));
  } String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc int i = 0; i 0 while (i < S.length()) {
      boolean found = false;
      for (int j = 0; j < keys.length; ++j) {
        int keylen = keys[j].length();
        if (i + keylen <= S.length()) {
          String s = S.substring(i, i + keylen);
          if (s.equals(keys[j])) {
            i += keylen;
            found = true;
            break;
          }
        }
      }
      if (!found) {
        break;
      }
    } i < S.length() i S.length() S.length S {
      boolean found = false;
      for (int j = 0; j < keys.length; ++j) {
        int keylen = keys[j].length();
        if (i + keylen <= S.length()) {
          String s = S.substring(i, i + keylen);
          if (s.equals(keys[j])) {
            i += keylen;
            found = true;
            break;
          }
        }
      }
      if (!found) {
        break;
      }
    } boolean found = false; found false for (int j = 0; j < keys.length; ++j) {
        int keylen = keys[j].length();
        if (i + keylen <= S.length()) {
          String s = S.substring(i, i + keylen);
          if (s.equals(keys[j])) {
            i += keylen;
            found = true;
            break;
          }
        }
      } int j = 0; int j = 0; j 0 j < keys.length j keys.length keys keys.length ++j ++j j {
        int keylen = keys[j].length();
        if (i + keylen <= S.length()) {
          String s = S.substring(i, i + keylen);
          if (s.equals(keys[j])) {
            i += keylen;
            found = true;
            break;
          }
        }
      } {
        int keylen = keys[j].length();
        if (i + keylen <= S.length()) {
          String s = S.substring(i, i + keylen);
          if (s.equals(keys[j])) {
            i += keylen;
            found = true;
            break;
          }
        }
      } int keylen = keys[j].length(); keylen keys[j].length() keys[j].length keys[j] keys j if (i + keylen <= S.length()) {
          String s = S.substring(i, i + keylen);
          if (s.equals(keys[j])) {
            i += keylen;
            found = true;
            break;
          }
        } i + keylen <= S.length() i + keylen i keylen S.length() S.length S {
          String s = S.substring(i, i + keylen);
          if (s.equals(keys[j])) {
            i += keylen;
            found = true;
            break;
          }
        } String s = S.substring(i, i + keylen); s S.substring(i, i + keylen) S.substring S i i + keylen i keylen if (s.equals(keys[j])) {
            i += keylen;
            found = true;
            break;
          } s.equals(keys[j]) s.equals s keys[j] keys j {
            i += keylen;
            found = true;
            break;
          } i += keylen i keylen found = true found true break; if (!found) {
        break;
      } !found found {
        break;
      } break; out.println((i == S.length() ? "YES" : "NO")) out.println out (i == S.length() ? "YES" : "NO") i == S.length() i S.length() S.length S "YES" "NO" Scanner sc sc PrintWriter out out private long C(long n, long r) {
    long res = 1;
    for (long i = n; i > n - r; --i) {
      res *= i;
    }
    for (long i = r; i > 1; --i) {
      res /= i;
    }
    return res;
  } C {
    long res = 1;
    for (long i = n; i > n - r; --i) {
      res *= i;
    }
    for (long i = r; i > 1; --i) {
      res /= i;
    }
    return res;
  } long res = 1; res 1 for (long i = n; i > n - r; --i) {
      res *= i;
    } long i = n; long i = n; i n i > n - r i n - r n r --i --i i {
      res *= i;
    } {
      res *= i;
    } res *= i res i for (long i = r; i > 1; --i) {
      res /= i;
    } long i = r; long i = r; i r i > 1 i 1 --i --i i {
      res /= i;
    } {
      res /= i;
    } res /= i res i return res; res long n n long r r private long P(long n, long r) {
    long res = 1;
    for (long i = n; i > n - r; --i) {
      res *= i;
    }
    return res;
  } P {
    long res = 1;
    for (long i = n; i > n - r; --i) {
      res *= i;
    }
    return res;
  } long res = 1; res 1 for (long i = n; i > n - r; --i) {
      res *= i;
    } long i = n; long i = n; i n i > n - r i n - r n r --i --i i {
      res *= i;
    } {
      res *= i;
    } res *= i res i return res; res long n n long r r private long ceil2pow(long n) {
    if (n == 0) {
      return 1;
    }
    n--;
    n |= (n >>> 1);
    n |= (n >>> 2);
    n |= (n >>> 4);
    n |= (n >>> 8);
    n |= (n >>> 16);
    n++;
    return n;
  } ceil2pow {
    if (n == 0) {
      return 1;
    }
    n--;
    n |= (n >>> 1);
    n |= (n >>> 2);
    n |= (n >>> 4);
    n |= (n >>> 8);
    n |= (n >>> 16);
    n++;
    return n;
  } if (n == 0) {
      return 1;
    } n == 0 n 0 {
      return 1;
    } return 1; 1 n-- n n |= (n >>> 1) n (n >>> 1) n 1 n |= (n >>> 2) n (n >>> 2) n 2 n |= (n >>> 4) n (n >>> 4) n 4 n |= (n >>> 8) n (n >>> 8) n 8 n |= (n >>> 16) n (n >>> 16) n 16 n++ n return n; n long n n /*
   * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
   * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
   */
  public static void main(String[] args) {
    long S = System.currentTimeMillis();

    Scanner sc = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
    new Main().solve(sc, out);
    out.flush();

    long G = System.currentTimeMillis();
    if (elapsed) {
      _err.println((G - S) + "ms");
    }
    _err.flush();
  } main {
    long S = System.currentTimeMillis();

    Scanner sc = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
    new Main().solve(sc, out);
    out.flush();

    long G = System.currentTimeMillis();
    if (elapsed) {
      _err.println((G - S) + "ms");
    }
    _err.flush();
  } long S = System.currentTimeMillis(); S System.currentTimeMillis() System.currentTimeMillis System Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) new Main().solve(sc, out) new Main().solve new Main() sc out out.flush() out.flush out long G = System.currentTimeMillis(); G System.currentTimeMillis() System.currentTimeMillis System if (elapsed) {
      _err.println((G - S) + "ms");
    } elapsed {
      _err.println((G - S) + "ms");
    } _err.println((G - S) + "ms") _err.println _err (G - S) + "ms" (G - S) G S "ms" _err.flush() _err.flush _err String[] args args public class Main {
  private static boolean debug = false;
  private static boolean elapsed = false;

  private static PrintWriter _err = new PrintWriter(System.err);

  private String[] keys = {
    "dreameraser", "dreamerase", "dreamer", "dream", "eraser", "erase"
  };

  private void solve(Scanner sc, PrintWriter out) {
    String S = sc.nextLine();

    int i = 0;
    while (i < S.length()) {
      boolean found = false;
      for (int j = 0; j < keys.length; ++j) {
        int keylen = keys[j].length();
        if (i + keylen <= S.length()) {
          String s = S.substring(i, i + keylen);
          if (s.equals(keys[j])) {
            i += keylen;
            found = true;
            break;
          }
        }
      }
      if (!found) {
        break;
      }
    }
    out.println((i == S.length() ? "YES" : "NO"));
  }
  private long C(long n, long r) {
    long res = 1;
    for (long i = n; i > n - r; --i) {
      res *= i;
    }
    for (long i = r; i > 1; --i) {
      res /= i;
    }
    return res;
  }
  private long P(long n, long r) {
    long res = 1;
    for (long i = n; i > n - r; --i) {
      res *= i;
    }
    return res;
  }
  private long ceil2pow(long n) {
    if (n == 0) {
      return 1;
    }
    n--;
    n |= (n >>> 1);
    n |= (n >>> 2);
    n |= (n >>> 4);
    n |= (n >>> 8);
    n |= (n >>> 16);
    n++;
    return n;
  }
  /*
   * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
   * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
   */
  public static void main(String[] args) {
    long S = System.currentTimeMillis();

    Scanner sc = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
    new Main().solve(sc, out);
    out.flush();

    long G = System.currentTimeMillis();
    if (elapsed) {
      _err.println((G - S) + "ms");
    }
    _err.flush();
  }
} public class Main {
  private static boolean debug = false;
  private static boolean elapsed = false;

  private static PrintWriter _err = new PrintWriter(System.err);

  private String[] keys = {
    "dreameraser", "dreamerase", "dreamer", "dream", "eraser", "erase"
  };

  private void solve(Scanner sc, PrintWriter out) {
    String S = sc.nextLine();

    int i = 0;
    while (i < S.length()) {
      boolean found = false;
      for (int j = 0; j < keys.length; ++j) {
        int keylen = keys[j].length();
        if (i + keylen <= S.length()) {
          String s = S.substring(i, i + keylen);
          if (s.equals(keys[j])) {
            i += keylen;
            found = true;
            break;
          }
        }
      }
      if (!found) {
        break;
      }
    }
    out.println((i == S.length() ? "YES" : "NO"));
  }
  private long C(long n, long r) {
    long res = 1;
    for (long i = n; i > n - r; --i) {
      res *= i;
    }
    for (long i = r; i > 1; --i) {
      res /= i;
    }
    return res;
  }
  private long P(long n, long r) {
    long res = 1;
    for (long i = n; i > n - r; --i) {
      res *= i;
    }
    return res;
  }
  private long ceil2pow(long n) {
    if (n == 0) {
      return 1;
    }
    n--;
    n |= (n >>> 1);
    n |= (n >>> 2);
    n |= (n >>> 4);
    n |= (n >>> 8);
    n |= (n >>> 16);
    n++;
    return n;
  }
  /*
   * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
   * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
   */
  public static void main(String[] args) {
    long S = System.currentTimeMillis();

    Scanner sc = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
    new Main().solve(sc, out);
    out.flush();

    long G = System.currentTimeMillis();
    if (elapsed) {
      _err.println((G - S) + "ms");
    }
    _err.flush();
  }
} Main
import java.io.*;
import java.util.*;

public class Main {
  private static boolean debug = false;
  private static boolean elapsed = false;

  private static PrintWriter _err = new PrintWriter(System.err);

  private String[] keys = {
    "dreameraser", "dreamerase", "dreamer", "dream", "eraser", "erase"
  };

  private void solve(Scanner sc, PrintWriter out) {
    String S = sc.nextLine();

    int i = 0;
    while (i < S.length()) {
      boolean found = false;
      for (int j = 0; j < keys.length; ++j) {
        int keylen = keys[j].length();
        if (i + keylen <= S.length()) {
          String s = S.substring(i, i + keylen);
          if (s.equals(keys[j])) {
            i += keylen;
            found = true;
            break;
          }
        }
      }
      if (!found) {
        break;
      }
    }
    out.println((i == S.length() ? "YES" : "NO"));
  }
  private long C(long n, long r) {
    long res = 1;
    for (long i = n; i > n - r; --i) {
      res *= i;
    }
    for (long i = r; i > 1; --i) {
      res /= i;
    }
    return res;
  }
  private long P(long n, long r) {
    long res = 1;
    for (long i = n; i > n - r; --i) {
      res *= i;
    }
    return res;
  }
  private long ceil2pow(long n) {
    if (n == 0) {
      return 1;
    }
    n--;
    n |= (n >>> 1);
    n |= (n >>> 2);
    n |= (n >>> 4);
    n |= (n >>> 8);
    n |= (n >>> 16);
    n++;
    return n;
  }
  /*
   * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
   * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
   */
  public static void main(String[] args) {
    long S = System.currentTimeMillis();

    Scanner sc = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
    new Main().solve(sc, out);
    out.flush();

    long G = System.currentTimeMillis();
    if (elapsed) {
      _err.println((G - S) + "ms");
    }
    _err.flush();
  }
}