import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException{
		Daydream solver = new Daydream();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	}

	static class Daydream {
		private String s;

		private Scanner scanner;
		private String output;

		public Daydream() {
			scanner = new Scanner(System.in);
		}

		public void readInput() {
			s = scanner.next();
		}

		public void solve() {
			String regex = "(dream(er)?|eraser?)+";
			output = s.matches(regex) ?"YES":"NO";

		}

		public void writeOutput() {
			System.out.println(output);
		}
	}


} import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) throws IOException{
		Daydream solver = new Daydream();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	}

	static class Daydream {
		private String s;

		private Scanner scanner;
		private String output;

		public Daydream() {
			scanner = new Scanner(System.in);
		}

		public void readInput() {
			s = scanner.next();
		}

		public void solve() {
			String regex = "(dream(er)?|eraser?)+";
			output = s.matches(regex) ?"YES":"NO";

		}

		public void writeOutput() {
			System.out.println(output);
		}
	}


} Main public static void main(String[] args) throws IOException{
		Daydream solver = new Daydream();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	} main {
		Daydream solver = new Daydream();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	} Daydream solver = new Daydream(); solver new Daydream() solver.readInput() solver.readInput solver solver.solve() solver.solve solver solver.writeOutput() solver.writeOutput solver String[] args args static class Daydream {
		private String s;

		private Scanner scanner;
		private String output;

		public Daydream() {
			scanner = new Scanner(System.in);
		}

		public void readInput() {
			s = scanner.next();
		}

		public void solve() {
			String regex = "(dream(er)?|eraser?)+";
			output = s.matches(regex) ?"YES":"NO";

		}

		public void writeOutput() {
			System.out.println(output);
		}
	} Daydream private String s; s private Scanner scanner; scanner private String output; output public Daydream() {
			scanner = new Scanner(System.in);
		} Daydream {
			scanner = new Scanner(System.in);
		} scanner = new Scanner(System.in) scanner new Scanner(System.in) public void readInput() {
			s = scanner.next();
		} readInput {
			s = scanner.next();
		} s = scanner.next() s scanner.next() scanner.next scanner public void solve() {
			String regex = "(dream(er)?|eraser?)+";
			output = s.matches(regex) ?"YES":"NO";

		} solve {
			String regex = "(dream(er)?|eraser?)+";
			output = s.matches(regex) ?"YES":"NO";

		} String regex = "(dream(er)?|eraser?)+"; regex "(dream(er)?|eraser?)+" output = s.matches(regex) ?"YES":"NO" output s.matches(regex) ?"YES":"NO" s.matches(regex) s.matches s regex "YES" "NO" public void writeOutput() {
			System.out.println(output);
		} writeOutput {
			System.out.println(output);
		} System.out.println(output) System.out.println System.out System System.out output public class Main {

	public static void main(String[] args) throws IOException{
		Daydream solver = new Daydream();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	}

	static class Daydream {
		private String s;

		private Scanner scanner;
		private String output;

		public Daydream() {
			scanner = new Scanner(System.in);
		}

		public void readInput() {
			s = scanner.next();
		}

		public void solve() {
			String regex = "(dream(er)?|eraser?)+";
			output = s.matches(regex) ?"YES":"NO";

		}

		public void writeOutput() {
			System.out.println(output);
		}
	}


} public class Main {

	public static void main(String[] args) throws IOException{
		Daydream solver = new Daydream();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	}

	static class Daydream {
		private String s;

		private Scanner scanner;
		private String output;

		public Daydream() {
			scanner = new Scanner(System.in);
		}

		public void readInput() {
			s = scanner.next();
		}

		public void solve() {
			String regex = "(dream(er)?|eraser?)+";
			output = s.matches(regex) ?"YES":"NO";

		}

		public void writeOutput() {
			System.out.println(output);
		}
	}


} Main
import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException{
		Daydream solver = new Daydream();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	}

	static class Daydream {
		private String s;

		private Scanner scanner;
		private String output;

		public Daydream() {
			scanner = new Scanner(System.in);
		}

		public void readInput() {
			s = scanner.next();
		}

		public void solve() {
			String regex = "(dream(er)?|eraser?)+";
			output = s.matches(regex) ?"YES":"NO";

		}

		public void writeOutput() {
			System.out.println(output);
		}
	}


}
