import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		String s;
		try (Scanner scanner = new Scanner(System.in)) {
			s = scanner.next();
		}

		boolean canObtain = s.replace("eraser",  " ")
				.replace("erase",   " ")
				.replace("dreamer", " ")
				.replace("dream",   " ")
				.trim()
				.isEmpty();

		if (canObtain) {
			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) {
		String s;
		try (Scanner scanner = new Scanner(System.in)) {
			s = scanner.next();
		}

		boolean canObtain = s.replace("eraser",  " ")
				.replace("erase",   " ")
				.replace("dreamer", " ")
				.replace("dream",   " ")
				.trim()
				.isEmpty();

		if (canObtain) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
} Main public static void main(String[] args) {
		String s;
		try (Scanner scanner = new Scanner(System.in)) {
			s = scanner.next();
		}

		boolean canObtain = s.replace("eraser",  " ")
				.replace("erase",   " ")
				.replace("dreamer", " ")
				.replace("dream",   " ")
				.trim()
				.isEmpty();

		if (canObtain) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	} main {
		String s;
		try (Scanner scanner = new Scanner(System.in)) {
			s = scanner.next();
		}

		boolean canObtain = s.replace("eraser",  " ")
				.replace("erase",   " ")
				.replace("dreamer", " ")
				.replace("dream",   " ")
				.trim()
				.isEmpty();

		if (canObtain) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	} String s; s try (Scanner scanner = new Scanner(System.in)) {
			s = scanner.next();
		} {
			s = scanner.next();
		} Scanner scanner = new Scanner(System.in) Scanner scanner = new Scanner(System.in) new Scanner(System.in) s = scanner.next() s scanner.next() scanner.next scanner boolean canObtain = s.replace("eraser",  " ")
				.replace("erase",   " ")
				.replace("dreamer", " ")
				.replace("dream",   " ")
				.trim()
				.isEmpty(); canObtain s.replace("eraser",  " ")
				.replace("erase",   " ")
				.replace("dreamer", " ")
				.replace("dream",   " ")
				.trim()
				.isEmpty() s.replace("eraser",  " ")
				.replace("erase",   " ")
				.replace("dreamer", " ")
				.replace("dream",   " ")
				.trim()
				.isEmpty s.replace("eraser",  " ")
				.replace("erase",   " ")
				.replace("dreamer", " ")
				.replace("dream",   " ")
				.trim() s.replace("eraser",  " ")
				.replace("erase",   " ")
				.replace("dreamer", " ")
				.replace("dream",   " ")
				.trim s.replace("eraser",  " ")
				.replace("erase",   " ")
				.replace("dreamer", " ")
				.replace("dream",   " ") s.replace("eraser",  " ")
				.replace("erase",   " ")
				.replace("dreamer", " ")
				.replace s.replace("eraser",  " ")
				.replace("erase",   " ")
				.replace("dreamer", " ") s.replace("eraser",  " ")
				.replace("erase",   " ")
				.replace s.replace("eraser",  " ")
				.replace("erase",   " ") s.replace("eraser",  " ")
				.replace s.replace("eraser",  " ") s.replace s "eraser" " " "erase" " " "dreamer" " " "dream" " " if (canObtain) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		} canObtain {
			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) {
		String s;
		try (Scanner scanner = new Scanner(System.in)) {
			s = scanner.next();
		}

		boolean canObtain = s.replace("eraser",  " ")
				.replace("erase",   " ")
				.replace("dreamer", " ")
				.replace("dream",   " ")
				.trim()
				.isEmpty();

		if (canObtain) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
} public class Main {
	public static void main(String[] args) {
		String s;
		try (Scanner scanner = new Scanner(System.in)) {
			s = scanner.next();
		}

		boolean canObtain = s.replace("eraser",  " ")
				.replace("erase",   " ")
				.replace("dreamer", " ")
				.replace("dream",   " ")
				.trim()
				.isEmpty();

		if (canObtain) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		String s;
		try (Scanner scanner = new Scanner(System.in)) {
			s = scanner.next();
		}

		boolean canObtain = s.replace("eraser",  " ")
				.replace("erase",   " ")
				.replace("dreamer", " ")
				.replace("dream",   " ")
				.trim()
				.isEmpty();

		if (canObtain) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
}