import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);
	static PrintStream so = System.out;
	public static void main(String[] args) throws InterruptedException {

		String s = sc.next();
		
		String[] a = {"dreameraser", "dreamerase", "dreamer", "dream", "eraser", "erase"};
		int idx = 0;
		
		outer: while (true) {
			for (String elem: a) {
				if (s.startsWith(elem, idx)) {
					idx += elem.length();
					if (idx == s.length()) {
						so.println("YES");
						return;
					}
					continue outer;
				}
			}
			
			so.println("NO");
			return;
		}
	}
} import java.io.PrintStream; PrintStream java.io import java.util.Scanner; Scanner java.util public class Main {
	static Scanner sc = new Scanner(System.in);
	static PrintStream so = System.out;
	public static void main(String[] args) throws InterruptedException {

		String s = sc.next();
		
		String[] a = {"dreameraser", "dreamerase", "dreamer", "dream", "eraser", "erase"};
		int idx = 0;
		
		outer: while (true) {
			for (String elem: a) {
				if (s.startsWith(elem, idx)) {
					idx += elem.length();
					if (idx == s.length()) {
						so.println("YES");
						return;
					}
					continue outer;
				}
			}
			
			so.println("NO");
			return;
		}
	}
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) static PrintStream so = System.out; so System.out System System.out public static void main(String[] args) throws InterruptedException {

		String s = sc.next();
		
		String[] a = {"dreameraser", "dreamerase", "dreamer", "dream", "eraser", "erase"};
		int idx = 0;
		
		outer: while (true) {
			for (String elem: a) {
				if (s.startsWith(elem, idx)) {
					idx += elem.length();
					if (idx == s.length()) {
						so.println("YES");
						return;
					}
					continue outer;
				}
			}
			
			so.println("NO");
			return;
		}
	} main {

		String s = sc.next();
		
		String[] a = {"dreameraser", "dreamerase", "dreamer", "dream", "eraser", "erase"};
		int idx = 0;
		
		outer: while (true) {
			for (String elem: a) {
				if (s.startsWith(elem, idx)) {
					idx += elem.length();
					if (idx == s.length()) {
						so.println("YES");
						return;
					}
					continue outer;
				}
			}
			
			so.println("NO");
			return;
		}
	} String s = sc.next(); s sc.next() sc.next sc String[] a = {"dreameraser", "dreamerase", "dreamer", "dream", "eraser", "erase"}; a {"dreameraser", "dreamerase", "dreamer", "dream", "eraser", "erase"} "dreameraser" "dreamerase" "dreamer" "dream" "eraser" "erase" int idx = 0; idx 0 String[] args args public class Main {
	static Scanner sc = new Scanner(System.in);
	static PrintStream so = System.out;
	public static void main(String[] args) throws InterruptedException {

		String s = sc.next();
		
		String[] a = {"dreameraser", "dreamerase", "dreamer", "dream", "eraser", "erase"};
		int idx = 0;
		
		outer: while (true) {
			for (String elem: a) {
				if (s.startsWith(elem, idx)) {
					idx += elem.length();
					if (idx == s.length()) {
						so.println("YES");
						return;
					}
					continue outer;
				}
			}
			
			so.println("NO");
			return;
		}
	}
} public class Main {
	static Scanner sc = new Scanner(System.in);
	static PrintStream so = System.out;
	public static void main(String[] args) throws InterruptedException {

		String s = sc.next();
		
		String[] a = {"dreameraser", "dreamerase", "dreamer", "dream", "eraser", "erase"};
		int idx = 0;
		
		outer: while (true) {
			for (String elem: a) {
				if (s.startsWith(elem, idx)) {
					idx += elem.length();
					if (idx == s.length()) {
						so.println("YES");
						return;
					}
					continue outer;
				}
			}
			
			so.println("NO");
			return;
		}
	}
} Main
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);
	static PrintStream so = System.out;
	public static void main(String[] args) throws InterruptedException {

		String s = sc.next();
		
		String[] a = {"dreameraser", "dreamerase", "dreamer", "dream", "eraser", "erase"};
		int idx = 0;
		
		outer: while (true) {
			for (String elem: a) {
				if (s.startsWith(elem, idx)) {
					idx += elem.length();
					if (idx == s.length()) {
						so.println("YES");
						return;
					}
					continue outer;
				}
			}
			
			so.println("NO");
			return;
		}
	}
}
