import java.util.*;
 
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    System.out.println(str.matches("((dream)|(dreamer)|(erase)|(eraser))*") ? "YES" : "NO");
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    System.out.println(str.matches("((dream)|(dreamer)|(erase)|(eraser))*") ? "YES" : "NO");
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    System.out.println(str.matches("((dream)|(dreamer)|(erase)|(eraser))*") ? "YES" : "NO");
  } main {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    System.out.println(str.matches("((dream)|(dreamer)|(erase)|(eraser))*") ? "YES" : "NO");
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc System.out.println(str.matches("((dream)|(dreamer)|(erase)|(eraser))*") ? "YES" : "NO") System.out.println System.out System System.out str.matches("((dream)|(dreamer)|(erase)|(eraser))*") ? "YES" : "NO" str.matches("((dream)|(dreamer)|(erase)|(eraser))*") str.matches str "((dream)|(dreamer)|(erase)|(eraser))*" "YES" "NO" String[] args args public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    System.out.println(str.matches("((dream)|(dreamer)|(erase)|(eraser))*") ? "YES" : "NO");
  }
} public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    System.out.println(str.matches("((dream)|(dreamer)|(erase)|(eraser))*") ? "YES" : "NO");
  }
} Main
import java.util.*;
 
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    System.out.println(str.matches("((dream)|(dreamer)|(erase)|(eraser))*") ? "YES" : "NO");
  }
}