import java.util.Scanner;
import java.util.ArrayList;
import java.util.HashMap;
import java.lang.Integer;
import java.lang.StringBuilder;
import java.lang.Math;

public class Main {
  private static char[] DREAMER = new String("dreamer").toCharArray();
  private static char[] DREAM = new String("dream").toCharArray();
  private static char[] ERASE = new String("erase").toCharArray();
  private static char[] ERASER = new String("eraser").toCharArray();

  private static boolean startsWith(char[] s, char[] target, int current) {
    int i = 0;
    while (current + i < target.length && i < s.length) {
      if (s[i] != target[current + i]) {
        return false;
      }

      i++;
    }

    return i == s.length;
  }

  public static boolean isDayDreamInternal(char[] s, int current) {
    if (current == s.length) return true;
    if (current >= s.length - 4) return false;

    if (startsWith(DREAMER, s, current)) {
      if (isDayDreamInternal(s, current + 7)) {
        return true;
      }
    }

    if (startsWith(ERASER, s, current)) {
      if (isDayDreamInternal(s, current + 6)) {
        return true;
      }
    }

    if (startsWith(ERASE, s, current) || startsWith(DREAM, s, current)) {
      if (isDayDreamInternal(s, current + 5)) {
        return true;
      }
    }

    return false;
  }

  public static boolean isDayDream(char[] s) {
    return isDayDreamInternal(s, 0);
  }

  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    char[] s = in.next().toCharArray();

    boolean result = isDayDream(s);

    if (result) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
    //System.out.println(s.substring(s.length()));
  }
} import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util import java.util.HashMap; HashMap java.util import java.lang.Integer; Integer java.lang import java.lang.StringBuilder; StringBuilder java.lang import java.lang.Math; Math java.lang public class Main {
  private static char[] DREAMER = new String("dreamer").toCharArray();
  private static char[] DREAM = new String("dream").toCharArray();
  private static char[] ERASE = new String("erase").toCharArray();
  private static char[] ERASER = new String("eraser").toCharArray();

  private static boolean startsWith(char[] s, char[] target, int current) {
    int i = 0;
    while (current + i < target.length && i < s.length) {
      if (s[i] != target[current + i]) {
        return false;
      }

      i++;
    }

    return i == s.length;
  }

  public static boolean isDayDreamInternal(char[] s, int current) {
    if (current == s.length) return true;
    if (current >= s.length - 4) return false;

    if (startsWith(DREAMER, s, current)) {
      if (isDayDreamInternal(s, current + 7)) {
        return true;
      }
    }

    if (startsWith(ERASER, s, current)) {
      if (isDayDreamInternal(s, current + 6)) {
        return true;
      }
    }

    if (startsWith(ERASE, s, current) || startsWith(DREAM, s, current)) {
      if (isDayDreamInternal(s, current + 5)) {
        return true;
      }
    }

    return false;
  }

  public static boolean isDayDream(char[] s) {
    return isDayDreamInternal(s, 0);
  }

  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    char[] s = in.next().toCharArray();

    boolean result = isDayDream(s);

    if (result) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
    //System.out.println(s.substring(s.length()));
  }
} Main private static char[] DREAMER = new String("dreamer").toCharArray(); DREAMER new String("dreamer").toCharArray() new String("dreamer").toCharArray new String("dreamer") private static char[] DREAM = new String("dream").toCharArray(); DREAM new String("dream").toCharArray() new String("dream").toCharArray new String("dream") private static char[] ERASE = new String("erase").toCharArray(); ERASE new String("erase").toCharArray() new String("erase").toCharArray new String("erase") private static char[] ERASER = new String("eraser").toCharArray(); ERASER new String("eraser").toCharArray() new String("eraser").toCharArray new String("eraser") private static boolean startsWith(char[] s, char[] target, int current) {
    int i = 0;
    while (current + i < target.length && i < s.length) {
      if (s[i] != target[current + i]) {
        return false;
      }

      i++;
    }

    return i == s.length;
  } startsWith {
    int i = 0;
    while (current + i < target.length && i < s.length) {
      if (s[i] != target[current + i]) {
        return false;
      }

      i++;
    }

    return i == s.length;
  } int i = 0; i 0 while (current + i < target.length && i < s.length) {
      if (s[i] != target[current + i]) {
        return false;
      }

      i++;
    } current + i < target.length && i < s.length current + i < target.length current + i current i target.length target target.length i < s.length i s.length s s.length {
      if (s[i] != target[current + i]) {
        return false;
      }

      i++;
    } if (s[i] != target[current + i]) {
        return false;
      } s[i] != target[current + i] s[i] s i target[current + i] target current + i current i {
        return false;
      } return false; false i++ i return i == s.length; i == s.length i s.length s s.length char[] s s char[] target target int current current public static boolean isDayDreamInternal(char[] s, int current) {
    if (current == s.length) return true;
    if (current >= s.length - 4) return false;

    if (startsWith(DREAMER, s, current)) {
      if (isDayDreamInternal(s, current + 7)) {
        return true;
      }
    }

    if (startsWith(ERASER, s, current)) {
      if (isDayDreamInternal(s, current + 6)) {
        return true;
      }
    }

    if (startsWith(ERASE, s, current) || startsWith(DREAM, s, current)) {
      if (isDayDreamInternal(s, current + 5)) {
        return true;
      }
    }

    return false;
  } isDayDreamInternal {
    if (current == s.length) return true;
    if (current >= s.length - 4) return false;

    if (startsWith(DREAMER, s, current)) {
      if (isDayDreamInternal(s, current + 7)) {
        return true;
      }
    }

    if (startsWith(ERASER, s, current)) {
      if (isDayDreamInternal(s, current + 6)) {
        return true;
      }
    }

    if (startsWith(ERASE, s, current) || startsWith(DREAM, s, current)) {
      if (isDayDreamInternal(s, current + 5)) {
        return true;
      }
    }

    return false;
  } if (current == s.length) return true; current == s.length current s.length s s.length return true; true if (current >= s.length - 4) return false; current >= s.length - 4 current s.length - 4 s.length s s.length 4 return false; false if (startsWith(DREAMER, s, current)) {
      if (isDayDreamInternal(s, current + 7)) {
        return true;
      }
    } startsWith(DREAMER, s, current) startsWith DREAMER s current {
      if (isDayDreamInternal(s, current + 7)) {
        return true;
      }
    } if (isDayDreamInternal(s, current + 7)) {
        return true;
      } isDayDreamInternal(s, current + 7) isDayDreamInternal s current + 7 current 7 {
        return true;
      } return true; true if (startsWith(ERASER, s, current)) {
      if (isDayDreamInternal(s, current + 6)) {
        return true;
      }
    } startsWith(ERASER, s, current) startsWith ERASER s current {
      if (isDayDreamInternal(s, current + 6)) {
        return true;
      }
    } if (isDayDreamInternal(s, current + 6)) {
        return true;
      } isDayDreamInternal(s, current + 6) isDayDreamInternal s current + 6 current 6 {
        return true;
      } return true; true if (startsWith(ERASE, s, current) || startsWith(DREAM, s, current)) {
      if (isDayDreamInternal(s, current + 5)) {
        return true;
      }
    } startsWith(ERASE, s, current) || startsWith(DREAM, s, current) startsWith(ERASE, s, current) startsWith ERASE s current startsWith(DREAM, s, current) startsWith DREAM s current {
      if (isDayDreamInternal(s, current + 5)) {
        return true;
      }
    } if (isDayDreamInternal(s, current + 5)) {
        return true;
      } isDayDreamInternal(s, current + 5) isDayDreamInternal s current + 5 current 5 {
        return true;
      } return true; true return false; false char[] s s int current current public static boolean isDayDream(char[] s) {
    return isDayDreamInternal(s, 0);
  } isDayDream {
    return isDayDreamInternal(s, 0);
  } return isDayDreamInternal(s, 0); isDayDreamInternal(s, 0) isDayDreamInternal s 0 char[] s s public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    char[] s = in.next().toCharArray();

    boolean result = isDayDream(s);

    if (result) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
    //System.out.println(s.substring(s.length()));
  } main {
    Scanner in = new Scanner(System.in);
    char[] s = in.next().toCharArray();

    boolean result = isDayDream(s);

    if (result) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
    //System.out.println(s.substring(s.length()));
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) char[] s = in.next().toCharArray(); s in.next().toCharArray() in.next().toCharArray in.next() in.next in boolean result = isDayDream(s); result isDayDream(s) isDayDream s if (result) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    } result {
      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 {
  private static char[] DREAMER = new String("dreamer").toCharArray();
  private static char[] DREAM = new String("dream").toCharArray();
  private static char[] ERASE = new String("erase").toCharArray();
  private static char[] ERASER = new String("eraser").toCharArray();

  private static boolean startsWith(char[] s, char[] target, int current) {
    int i = 0;
    while (current + i < target.length && i < s.length) {
      if (s[i] != target[current + i]) {
        return false;
      }

      i++;
    }

    return i == s.length;
  }

  public static boolean isDayDreamInternal(char[] s, int current) {
    if (current == s.length) return true;
    if (current >= s.length - 4) return false;

    if (startsWith(DREAMER, s, current)) {
      if (isDayDreamInternal(s, current + 7)) {
        return true;
      }
    }

    if (startsWith(ERASER, s, current)) {
      if (isDayDreamInternal(s, current + 6)) {
        return true;
      }
    }

    if (startsWith(ERASE, s, current) || startsWith(DREAM, s, current)) {
      if (isDayDreamInternal(s, current + 5)) {
        return true;
      }
    }

    return false;
  }

  public static boolean isDayDream(char[] s) {
    return isDayDreamInternal(s, 0);
  }

  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    char[] s = in.next().toCharArray();

    boolean result = isDayDream(s);

    if (result) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
    //System.out.println(s.substring(s.length()));
  }
} public class Main {
  private static char[] DREAMER = new String("dreamer").toCharArray();
  private static char[] DREAM = new String("dream").toCharArray();
  private static char[] ERASE = new String("erase").toCharArray();
  private static char[] ERASER = new String("eraser").toCharArray();

  private static boolean startsWith(char[] s, char[] target, int current) {
    int i = 0;
    while (current + i < target.length && i < s.length) {
      if (s[i] != target[current + i]) {
        return false;
      }

      i++;
    }

    return i == s.length;
  }

  public static boolean isDayDreamInternal(char[] s, int current) {
    if (current == s.length) return true;
    if (current >= s.length - 4) return false;

    if (startsWith(DREAMER, s, current)) {
      if (isDayDreamInternal(s, current + 7)) {
        return true;
      }
    }

    if (startsWith(ERASER, s, current)) {
      if (isDayDreamInternal(s, current + 6)) {
        return true;
      }
    }

    if (startsWith(ERASE, s, current) || startsWith(DREAM, s, current)) {
      if (isDayDreamInternal(s, current + 5)) {
        return true;
      }
    }

    return false;
  }

  public static boolean isDayDream(char[] s) {
    return isDayDreamInternal(s, 0);
  }

  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    char[] s = in.next().toCharArray();

    boolean result = isDayDream(s);

    if (result) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
    //System.out.println(s.substring(s.length()));
  }
} Main
import java.util.Scanner;
import java.util.ArrayList;
import java.util.HashMap;
import java.lang.Integer;
import java.lang.StringBuilder;
import java.lang.Math;

public class Main {
  private static char[] DREAMER = new String("dreamer").toCharArray();
  private static char[] DREAM = new String("dream").toCharArray();
  private static char[] ERASE = new String("erase").toCharArray();
  private static char[] ERASER = new String("eraser").toCharArray();

  private static boolean startsWith(char[] s, char[] target, int current) {
    int i = 0;
    while (current + i < target.length && i < s.length) {
      if (s[i] != target[current + i]) {
        return false;
      }

      i++;
    }

    return i == s.length;
  }

  public static boolean isDayDreamInternal(char[] s, int current) {
    if (current == s.length) return true;
    if (current >= s.length - 4) return false;

    if (startsWith(DREAMER, s, current)) {
      if (isDayDreamInternal(s, current + 7)) {
        return true;
      }
    }

    if (startsWith(ERASER, s, current)) {
      if (isDayDreamInternal(s, current + 6)) {
        return true;
      }
    }

    if (startsWith(ERASE, s, current) || startsWith(DREAM, s, current)) {
      if (isDayDreamInternal(s, current + 5)) {
        return true;
      }
    }

    return false;
  }

  public static boolean isDayDream(char[] s) {
    return isDayDreamInternal(s, 0);
  }

  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    char[] s = in.next().toCharArray();

    boolean result = isDayDream(s);

    if (result) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
    //System.out.println(s.substring(s.length()));
  }
}