import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		if (s.replaceAll("eraser", "X").replaceAll("erase", "X").replaceAll("dreamer", "X").replaceAll("dream", "X")
				.replaceAll("X", "")
				.equals("")) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
		sc.close();

	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		if (s.replaceAll("eraser", "X").replaceAll("erase", "X").replaceAll("dreamer", "X").replaceAll("dream", "X")
				.replaceAll("X", "")
				.equals("")) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
		sc.close();

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		if (s.replaceAll("eraser", "X").replaceAll("erase", "X").replaceAll("dreamer", "X").replaceAll("dream", "X")
				.replaceAll("X", "")
				.equals("")) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
		sc.close();

	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		if (s.replaceAll("eraser", "X").replaceAll("erase", "X").replaceAll("dreamer", "X").replaceAll("dream", "X")
				.replaceAll("X", "")
				.equals("")) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
		sc.close();

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc if (s.replaceAll("eraser", "X").replaceAll("erase", "X").replaceAll("dreamer", "X").replaceAll("dream", "X")
				.replaceAll("X", "")
				.equals("")) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		} s.replaceAll("eraser", "X").replaceAll("erase", "X").replaceAll("dreamer", "X").replaceAll("dream", "X")
				.replaceAll("X", "")
				.equals("") s.replaceAll("eraser", "X").replaceAll("erase", "X").replaceAll("dreamer", "X").replaceAll("dream", "X")
				.replaceAll("X", "")
				.equals s.replaceAll("eraser", "X").replaceAll("erase", "X").replaceAll("dreamer", "X").replaceAll("dream", "X")
				.replaceAll("X", "") s.replaceAll("eraser", "X").replaceAll("erase", "X").replaceAll("dreamer", "X").replaceAll("dream", "X")
				.replaceAll s.replaceAll("eraser", "X").replaceAll("erase", "X").replaceAll("dreamer", "X").replaceAll("dream", "X") s.replaceAll("eraser", "X").replaceAll("erase", "X").replaceAll("dreamer", "X").replaceAll s.replaceAll("eraser", "X").replaceAll("erase", "X").replaceAll("dreamer", "X") s.replaceAll("eraser", "X").replaceAll("erase", "X").replaceAll s.replaceAll("eraser", "X").replaceAll("erase", "X") s.replaceAll("eraser", "X").replaceAll s.replaceAll("eraser", "X") s.replaceAll s "eraser" "X" "erase" "X" "dreamer" "X" "dream" "X" "X" "" "" {
			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" sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		if (s.replaceAll("eraser", "X").replaceAll("erase", "X").replaceAll("dreamer", "X").replaceAll("dream", "X")
				.replaceAll("X", "")
				.equals("")) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
		sc.close();

	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		if (s.replaceAll("eraser", "X").replaceAll("erase", "X").replaceAll("dreamer", "X").replaceAll("dream", "X")
				.replaceAll("X", "")
				.equals("")) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
		sc.close();

	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		if (s.replaceAll("eraser", "X").replaceAll("erase", "X").replaceAll("dreamer", "X").replaceAll("dream", "X")
				.replaceAll("X", "")
				.equals("")) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
		sc.close();

	}
}