import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String text = sc.next();
    text = text.replace("eraser", "-");
    text = text.replace("erase", "-");
    text = text.replace("dreamer", "-");
    text = text.replace("dream", "-");
    text = text.replace("-", "");
    if (text.isEmpty()) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
      
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String text = sc.next();
    text = text.replace("eraser", "-");
    text = text.replace("erase", "-");
    text = text.replace("dreamer", "-");
    text = text.replace("dream", "-");
    text = text.replace("-", "");
    if (text.isEmpty()) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
      
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String text = sc.next();
    text = text.replace("eraser", "-");
    text = text.replace("erase", "-");
    text = text.replace("dreamer", "-");
    text = text.replace("dream", "-");
    text = text.replace("-", "");
    if (text.isEmpty()) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
      
  } main {
    Scanner sc = new Scanner(System.in);
    String text = sc.next();
    text = text.replace("eraser", "-");
    text = text.replace("erase", "-");
    text = text.replace("dreamer", "-");
    text = text.replace("dream", "-");
    text = text.replace("-", "");
    if (text.isEmpty()) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
      
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String text = sc.next(); text sc.next() sc.next sc text = text.replace("eraser", "-") text text.replace("eraser", "-") text.replace text "eraser" "-" text = text.replace("erase", "-") text text.replace("erase", "-") text.replace text "erase" "-" text = text.replace("dreamer", "-") text text.replace("dreamer", "-") text.replace text "dreamer" "-" text = text.replace("dream", "-") text text.replace("dream", "-") text.replace text "dream" "-" text = text.replace("-", "") text text.replace("-", "") text.replace text "-" "" if (text.isEmpty()) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    } text.isEmpty() text.isEmpty text {
      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 {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String text = sc.next();
    text = text.replace("eraser", "-");
    text = text.replace("erase", "-");
    text = text.replace("dreamer", "-");
    text = text.replace("dream", "-");
    text = text.replace("-", "");
    if (text.isEmpty()) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
      
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String text = sc.next();
    text = text.replace("eraser", "-");
    text = text.replace("erase", "-");
    text = text.replace("dreamer", "-");
    text = text.replace("dream", "-");
    text = text.replace("-", "");
    if (text.isEmpty()) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
      
  }
} Main
import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String text = sc.next();
    text = text.replace("eraser", "-");
    text = text.replace("erase", "-");
    text = text.replace("dreamer", "-");
    text = text.replace("dream", "-");
    text = text.replace("-", "");
    if (text.isEmpty()) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
      
  }
}
