import java.util.*;

public class Main {

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

	public static void main(
			String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		System.out.println(s.matches("(dream(er)?|eraser?)+") ? "YES": "NO");
	}
} Main public static void main(
			String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		System.out.println(s.matches("(dream(er)?|eraser?)+") ? "YES": "NO");
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		System.out.println(s.matches("(dream(er)?|eraser?)+") ? "YES": "NO");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc System.out.println(s.matches("(dream(er)?|eraser?)+") ? "YES": "NO") System.out.println System.out System System.out s.matches("(dream(er)?|eraser?)+") ? "YES": "NO" s.matches("(dream(er)?|eraser?)+") s.matches s "(dream(er)?|eraser?)+" "YES" "NO" String[] args args public class Main {

	public static void main(
			String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		System.out.println(s.matches("(dream(er)?|eraser?)+") ? "YES": "NO");
	}
} public class Main {

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

public class Main {

	public static void main(
			String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		System.out.println(s.matches("(dream(er)?|eraser?)+") ? "YES": "NO");
	}
}
