import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    int pos = S.length();
    String ans = "YES";
    while(pos > 0) {
      String s5 = "";
      String s6 = "";
      String s7 = "";
      int count = 0;
      if(pos - 7 >= 0) {
        s7 = S.substring(pos - 7, pos);
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s7.equals("dreamer")) {
          pos -= 7;
          count++;
        } else if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 6 >= 0) {
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 5 >= 0) {
        s5 = S.substring(pos - 5, pos);
        if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      }
      if(count == 0) {
        ans = "NO";
        break;
      }
    }
    System.out.println(ans);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    int pos = S.length();
    String ans = "YES";
    while(pos > 0) {
      String s5 = "";
      String s6 = "";
      String s7 = "";
      int count = 0;
      if(pos - 7 >= 0) {
        s7 = S.substring(pos - 7, pos);
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s7.equals("dreamer")) {
          pos -= 7;
          count++;
        } else if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 6 >= 0) {
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 5 >= 0) {
        s5 = S.substring(pos - 5, pos);
        if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      }
      if(count == 0) {
        ans = "NO";
        break;
      }
    }
    System.out.println(ans);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    int pos = S.length();
    String ans = "YES";
    while(pos > 0) {
      String s5 = "";
      String s6 = "";
      String s7 = "";
      int count = 0;
      if(pos - 7 >= 0) {
        s7 = S.substring(pos - 7, pos);
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s7.equals("dreamer")) {
          pos -= 7;
          count++;
        } else if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 6 >= 0) {
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 5 >= 0) {
        s5 = S.substring(pos - 5, pos);
        if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      }
      if(count == 0) {
        ans = "NO";
        break;
      }
    }
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    int pos = S.length();
    String ans = "YES";
    while(pos > 0) {
      String s5 = "";
      String s6 = "";
      String s7 = "";
      int count = 0;
      if(pos - 7 >= 0) {
        s7 = S.substring(pos - 7, pos);
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s7.equals("dreamer")) {
          pos -= 7;
          count++;
        } else if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 6 >= 0) {
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 5 >= 0) {
        s5 = S.substring(pos - 5, pos);
        if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      }
      if(count == 0) {
        ans = "NO";
        break;
      }
    }
    System.out.println(ans);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int pos = S.length(); pos S.length() S.length S String ans = "YES"; ans "YES" while(pos > 0) {
      String s5 = "";
      String s6 = "";
      String s7 = "";
      int count = 0;
      if(pos - 7 >= 0) {
        s7 = S.substring(pos - 7, pos);
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s7.equals("dreamer")) {
          pos -= 7;
          count++;
        } else if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 6 >= 0) {
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 5 >= 0) {
        s5 = S.substring(pos - 5, pos);
        if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      }
      if(count == 0) {
        ans = "NO";
        break;
      }
    } pos > 0 pos 0 {
      String s5 = "";
      String s6 = "";
      String s7 = "";
      int count = 0;
      if(pos - 7 >= 0) {
        s7 = S.substring(pos - 7, pos);
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s7.equals("dreamer")) {
          pos -= 7;
          count++;
        } else if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 6 >= 0) {
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 5 >= 0) {
        s5 = S.substring(pos - 5, pos);
        if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      }
      if(count == 0) {
        ans = "NO";
        break;
      }
    } String s5 = ""; s5 "" String s6 = ""; s6 "" String s7 = ""; s7 "" int count = 0; count 0 if(pos - 7 >= 0) {
        s7 = S.substring(pos - 7, pos);
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s7.equals("dreamer")) {
          pos -= 7;
          count++;
        } else if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 6 >= 0) {
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 5 >= 0) {
        s5 = S.substring(pos - 5, pos);
        if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } pos - 7 >= 0 pos - 7 pos 7 0 {
        s7 = S.substring(pos - 7, pos);
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s7.equals("dreamer")) {
          pos -= 7;
          count++;
        } else if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } s7 = S.substring(pos - 7, pos) s7 S.substring(pos - 7, pos) S.substring S pos - 7 pos 7 pos s6 = S.substring(pos - 6, pos) s6 S.substring(pos - 6, pos) S.substring S pos - 6 pos 6 pos s5 = S.substring(pos - 5, pos) s5 S.substring(pos - 5, pos) S.substring S pos - 5 pos 5 pos if(s7.equals("dreamer")) {
          pos -= 7;
          count++;
        } else if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        } s7.equals("dreamer") s7.equals s7 "dreamer" {
          pos -= 7;
          count++;
        } pos -= 7 pos 7 count++ count if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        } s6.equals("eraser") s6.equals s6 "eraser" {
          pos -= 6;
          count++;
        } pos -= 6 pos 6 count++ count if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        } s5.equals("dream") || s5.equals("erase") s5.equals("dream") s5.equals s5 "dream" s5.equals("erase") s5.equals s5 "erase" {
          pos -= 5;
          count++;
        } pos -= 5 pos 5 count++ count if(pos - 6 >= 0) {
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 5 >= 0) {
        s5 = S.substring(pos - 5, pos);
        if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } pos - 6 >= 0 pos - 6 pos 6 0 {
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } s6 = S.substring(pos - 6, pos) s6 S.substring(pos - 6, pos) S.substring S pos - 6 pos 6 pos s5 = S.substring(pos - 5, pos) s5 S.substring(pos - 5, pos) S.substring S pos - 5 pos 5 pos if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        } s6.equals("eraser") s6.equals s6 "eraser" {
          pos -= 6;
          count++;
        } pos -= 6 pos 6 count++ count if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        } s5.equals("dream") || s5.equals("erase") s5.equals("dream") s5.equals s5 "dream" s5.equals("erase") s5.equals s5 "erase" {
          pos -= 5;
          count++;
        } pos -= 5 pos 5 count++ count if(pos - 5 >= 0) {
        s5 = S.substring(pos - 5, pos);
        if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } pos - 5 >= 0 pos - 5 pos 5 0 {
        s5 = S.substring(pos - 5, pos);
        if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } s5 = S.substring(pos - 5, pos) s5 S.substring(pos - 5, pos) S.substring S pos - 5 pos 5 pos if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        } s5.equals("dream") || s5.equals("erase") s5.equals("dream") s5.equals s5 "dream" s5.equals("erase") s5.equals s5 "erase" {
          pos -= 5;
          count++;
        } pos -= 5 pos 5 count++ count if(count == 0) {
        ans = "NO";
        break;
      } count == 0 count 0 {
        ans = "NO";
        break;
      } ans = "NO" ans "NO" break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    int pos = S.length();
    String ans = "YES";
    while(pos > 0) {
      String s5 = "";
      String s6 = "";
      String s7 = "";
      int count = 0;
      if(pos - 7 >= 0) {
        s7 = S.substring(pos - 7, pos);
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s7.equals("dreamer")) {
          pos -= 7;
          count++;
        } else if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 6 >= 0) {
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 5 >= 0) {
        s5 = S.substring(pos - 5, pos);
        if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      }
      if(count == 0) {
        ans = "NO";
        break;
      }
    }
    System.out.println(ans);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    int pos = S.length();
    String ans = "YES";
    while(pos > 0) {
      String s5 = "";
      String s6 = "";
      String s7 = "";
      int count = 0;
      if(pos - 7 >= 0) {
        s7 = S.substring(pos - 7, pos);
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s7.equals("dreamer")) {
          pos -= 7;
          count++;
        } else if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 6 >= 0) {
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 5 >= 0) {
        s5 = S.substring(pos - 5, pos);
        if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      }
      if(count == 0) {
        ans = "NO";
        break;
      }
    }
    System.out.println(ans);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    int pos = S.length();
    String ans = "YES";
    while(pos > 0) {
      String s5 = "";
      String s6 = "";
      String s7 = "";
      int count = 0;
      if(pos - 7 >= 0) {
        s7 = S.substring(pos - 7, pos);
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s7.equals("dreamer")) {
          pos -= 7;
          count++;
        } else if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 6 >= 0) {
        s6 = S.substring(pos - 6, pos);
        s5 = S.substring(pos - 5, pos);
        if(s6.equals("eraser")) {
          pos -= 6;
          count++;
        } else if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      } else if(pos - 5 >= 0) {
        s5 = S.substring(pos - 5, pos);
        if(s5.equals("dream") || s5.equals("erase")) {
          pos -= 5;
          count++;
        }
      }
      if(count == 0) {
        ans = "NO";
        break;
      }
    }
    System.out.println(ans);
  }
}