import java.util.Scanner;
public class Main {
	public static void main(String args[]){
		run();
	}
	static void run(){
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String tmp;
		StringBuilder eraser = new StringBuilder();
		String erasera[] = new String[10000];
		erasera = s.split("eraser");
		for(int i = 0; i < erasera.length; i++){
			eraser.append(erasera[i]);
		}
		StringBuilder dreamer = new StringBuilder();
		String dreamera[] = new String[10000];
		tmp = eraser.toString();
		dreamera = tmp.split("erase");
		for(int i = 0; i < dreamera.length; i++){
			dreamer.append(dreamera[i]);
		}
		StringBuilder erase = new StringBuilder();
		String erasea[] = new String[10000];
		tmp = dreamer.toString();
		erasea = tmp.split("dreamer");
		for(int i = 0; i < erasea.length; i++){
			erase.append(erasea[i]);
		}
		StringBuilder dream = new StringBuilder();
		String dreama[] = new String[10000];
		tmp = erase.toString();
		dreama = tmp.split("dream");
		for(int i = 0; i < dreama.length; i++){
			dream.append(dreama[i]);
		}
		dream.append("*");
		tmp = dream.toString();
		if(tmp.equals("*")){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String args[]){
		run();
	}
	static void run(){
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String tmp;
		StringBuilder eraser = new StringBuilder();
		String erasera[] = new String[10000];
		erasera = s.split("eraser");
		for(int i = 0; i < erasera.length; i++){
			eraser.append(erasera[i]);
		}
		StringBuilder dreamer = new StringBuilder();
		String dreamera[] = new String[10000];
		tmp = eraser.toString();
		dreamera = tmp.split("erase");
		for(int i = 0; i < dreamera.length; i++){
			dreamer.append(dreamera[i]);
		}
		StringBuilder erase = new StringBuilder();
		String erasea[] = new String[10000];
		tmp = dreamer.toString();
		erasea = tmp.split("dreamer");
		for(int i = 0; i < erasea.length; i++){
			erase.append(erasea[i]);
		}
		StringBuilder dream = new StringBuilder();
		String dreama[] = new String[10000];
		tmp = erase.toString();
		dreama = tmp.split("dream");
		for(int i = 0; i < dreama.length; i++){
			dream.append(dreama[i]);
		}
		dream.append("*");
		tmp = dream.toString();
		if(tmp.equals("*")){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
} Main public static void main(String args[]){
		run();
	} main {
		run();
	} run() run String args[] args static void run(){
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String tmp;
		StringBuilder eraser = new StringBuilder();
		String erasera[] = new String[10000];
		erasera = s.split("eraser");
		for(int i = 0; i < erasera.length; i++){
			eraser.append(erasera[i]);
		}
		StringBuilder dreamer = new StringBuilder();
		String dreamera[] = new String[10000];
		tmp = eraser.toString();
		dreamera = tmp.split("erase");
		for(int i = 0; i < dreamera.length; i++){
			dreamer.append(dreamera[i]);
		}
		StringBuilder erase = new StringBuilder();
		String erasea[] = new String[10000];
		tmp = dreamer.toString();
		erasea = tmp.split("dreamer");
		for(int i = 0; i < erasea.length; i++){
			erase.append(erasea[i]);
		}
		StringBuilder dream = new StringBuilder();
		String dreama[] = new String[10000];
		tmp = erase.toString();
		dreama = tmp.split("dream");
		for(int i = 0; i < dreama.length; i++){
			dream.append(dreama[i]);
		}
		dream.append("*");
		tmp = dream.toString();
		if(tmp.equals("*")){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	} run {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String tmp;
		StringBuilder eraser = new StringBuilder();
		String erasera[] = new String[10000];
		erasera = s.split("eraser");
		for(int i = 0; i < erasera.length; i++){
			eraser.append(erasera[i]);
		}
		StringBuilder dreamer = new StringBuilder();
		String dreamera[] = new String[10000];
		tmp = eraser.toString();
		dreamera = tmp.split("erase");
		for(int i = 0; i < dreamera.length; i++){
			dreamer.append(dreamera[i]);
		}
		StringBuilder erase = new StringBuilder();
		String erasea[] = new String[10000];
		tmp = dreamer.toString();
		erasea = tmp.split("dreamer");
		for(int i = 0; i < erasea.length; i++){
			erase.append(erasea[i]);
		}
		StringBuilder dream = new StringBuilder();
		String dreama[] = new String[10000];
		tmp = erase.toString();
		dreama = tmp.split("dream");
		for(int i = 0; i < dreama.length; i++){
			dream.append(dreama[i]);
		}
		dream.append("*");
		tmp = dream.toString();
		if(tmp.equals("*")){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String s = scan.next(); s scan.next() scan.next scan String tmp; tmp StringBuilder eraser = new StringBuilder(); eraser new StringBuilder() String erasera[] = new String[10000]; erasera new String[10000] 10000 erasera = s.split("eraser") erasera s.split("eraser") s.split s "eraser" for(int i = 0; i < erasera.length; i++){
			eraser.append(erasera[i]);
		} int i = 0; int i = 0; i 0 i < erasera.length i erasera.length erasera erasera.length i++ i++ i {
			eraser.append(erasera[i]);
		} {
			eraser.append(erasera[i]);
		} eraser.append(erasera[i]) eraser.append eraser erasera[i] erasera i StringBuilder dreamer = new StringBuilder(); dreamer new StringBuilder() String dreamera[] = new String[10000]; dreamera new String[10000] 10000 tmp = eraser.toString() tmp eraser.toString() eraser.toString eraser dreamera = tmp.split("erase") dreamera tmp.split("erase") tmp.split tmp "erase" for(int i = 0; i < dreamera.length; i++){
			dreamer.append(dreamera[i]);
		} int i = 0; int i = 0; i 0 i < dreamera.length i dreamera.length dreamera dreamera.length i++ i++ i {
			dreamer.append(dreamera[i]);
		} {
			dreamer.append(dreamera[i]);
		} dreamer.append(dreamera[i]) dreamer.append dreamer dreamera[i] dreamera i StringBuilder erase = new StringBuilder(); erase new StringBuilder() String erasea[] = new String[10000]; erasea new String[10000] 10000 tmp = dreamer.toString() tmp dreamer.toString() dreamer.toString dreamer erasea = tmp.split("dreamer") erasea tmp.split("dreamer") tmp.split tmp "dreamer" for(int i = 0; i < erasea.length; i++){
			erase.append(erasea[i]);
		} int i = 0; int i = 0; i 0 i < erasea.length i erasea.length erasea erasea.length i++ i++ i {
			erase.append(erasea[i]);
		} {
			erase.append(erasea[i]);
		} erase.append(erasea[i]) erase.append erase erasea[i] erasea i StringBuilder dream = new StringBuilder(); dream new StringBuilder() String dreama[] = new String[10000]; dreama new String[10000] 10000 tmp = erase.toString() tmp erase.toString() erase.toString erase dreama = tmp.split("dream") dreama tmp.split("dream") tmp.split tmp "dream" for(int i = 0; i < dreama.length; i++){
			dream.append(dreama[i]);
		} int i = 0; int i = 0; i 0 i < dreama.length i dreama.length dreama dreama.length i++ i++ i {
			dream.append(dreama[i]);
		} {
			dream.append(dreama[i]);
		} dream.append(dreama[i]) dream.append dream dreama[i] dreama i dream.append("*") dream.append dream "*" tmp = dream.toString() tmp dream.toString() dream.toString dream if(tmp.equals("*")){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		} tmp.equals("*") tmp.equals tmp "*" {
			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" public class Main {
	public static void main(String args[]){
		run();
	}
	static void run(){
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String tmp;
		StringBuilder eraser = new StringBuilder();
		String erasera[] = new String[10000];
		erasera = s.split("eraser");
		for(int i = 0; i < erasera.length; i++){
			eraser.append(erasera[i]);
		}
		StringBuilder dreamer = new StringBuilder();
		String dreamera[] = new String[10000];
		tmp = eraser.toString();
		dreamera = tmp.split("erase");
		for(int i = 0; i < dreamera.length; i++){
			dreamer.append(dreamera[i]);
		}
		StringBuilder erase = new StringBuilder();
		String erasea[] = new String[10000];
		tmp = dreamer.toString();
		erasea = tmp.split("dreamer");
		for(int i = 0; i < erasea.length; i++){
			erase.append(erasea[i]);
		}
		StringBuilder dream = new StringBuilder();
		String dreama[] = new String[10000];
		tmp = erase.toString();
		dreama = tmp.split("dream");
		for(int i = 0; i < dreama.length; i++){
			dream.append(dreama[i]);
		}
		dream.append("*");
		tmp = dream.toString();
		if(tmp.equals("*")){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
} public class Main {
	public static void main(String args[]){
		run();
	}
	static void run(){
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String tmp;
		StringBuilder eraser = new StringBuilder();
		String erasera[] = new String[10000];
		erasera = s.split("eraser");
		for(int i = 0; i < erasera.length; i++){
			eraser.append(erasera[i]);
		}
		StringBuilder dreamer = new StringBuilder();
		String dreamera[] = new String[10000];
		tmp = eraser.toString();
		dreamera = tmp.split("erase");
		for(int i = 0; i < dreamera.length; i++){
			dreamer.append(dreamera[i]);
		}
		StringBuilder erase = new StringBuilder();
		String erasea[] = new String[10000];
		tmp = dreamer.toString();
		erasea = tmp.split("dreamer");
		for(int i = 0; i < erasea.length; i++){
			erase.append(erasea[i]);
		}
		StringBuilder dream = new StringBuilder();
		String dreama[] = new String[10000];
		tmp = erase.toString();
		dreama = tmp.split("dream");
		for(int i = 0; i < dreama.length; i++){
			dream.append(dreama[i]);
		}
		dream.append("*");
		tmp = dream.toString();
		if(tmp.equals("*")){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String args[]){
		run();
	}
	static void run(){
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String tmp;
		StringBuilder eraser = new StringBuilder();
		String erasera[] = new String[10000];
		erasera = s.split("eraser");
		for(int i = 0; i < erasera.length; i++){
			eraser.append(erasera[i]);
		}
		StringBuilder dreamer = new StringBuilder();
		String dreamera[] = new String[10000];
		tmp = eraser.toString();
		dreamera = tmp.split("erase");
		for(int i = 0; i < dreamera.length; i++){
			dreamer.append(dreamera[i]);
		}
		StringBuilder erase = new StringBuilder();
		String erasea[] = new String[10000];
		tmp = dreamer.toString();
		erasea = tmp.split("dreamer");
		for(int i = 0; i < erasea.length; i++){
			erase.append(erasea[i]);
		}
		StringBuilder dream = new StringBuilder();
		String dreama[] = new String[10000];
		tmp = erase.toString();
		dreama = tmp.split("dream");
		for(int i = 0; i < dreama.length; i++){
			dream.append(dreama[i]);
		}
		dream.append("*");
		tmp = dream.toString();
		if(tmp.equals("*")){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
}
