import java.util.Scanner;
import java.util.regex.Pattern;

public class Main {
	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		String s=scanner.next();
		Pattern p=Pattern.compile("^(dream|dreamer|erase|eraser)+$");
		if(p.matcher(s).find()) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}
} import java.util.Scanner; Scanner java.util import java.util.regex.Pattern; Pattern java.util.regex public class Main {
	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		String s=scanner.next();
		Pattern p=Pattern.compile("^(dream|dreamer|erase|eraser)+$");
		if(p.matcher(s).find()) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}
} Main @SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		String s=scanner.next();
		Pattern p=Pattern.compile("^(dream|dreamer|erase|eraser)+$");
		if(p.matcher(s).find()) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	} main {
		Scanner scanner = new Scanner(System.in);
		String s=scanner.next();
		Pattern p=Pattern.compile("^(dream|dreamer|erase|eraser)+$");
		if(p.matcher(s).find()) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String s=scanner.next(); s scanner.next() scanner.next scanner Pattern p=Pattern.compile("^(dream|dreamer|erase|eraser)+$"); p Pattern.compile("^(dream|dreamer|erase|eraser)+$") Pattern.compile Pattern "^(dream|dreamer|erase|eraser)+$" if(p.matcher(s).find()) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		} p.matcher(s).find() p.matcher(s).find p.matcher(s) p.matcher p s {
			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 {
	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		String s=scanner.next();
		Pattern p=Pattern.compile("^(dream|dreamer|erase|eraser)+$");
		if(p.matcher(s).find()) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}
} public class Main {
	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		String s=scanner.next();
		Pattern p=Pattern.compile("^(dream|dreamer|erase|eraser)+$");
		if(p.matcher(s).find()) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}
} Main
import java.util.Scanner;
import java.util.regex.Pattern;

public class Main {
	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		String s=scanner.next();
		Pattern p=Pattern.compile("^(dream|dreamer|erase|eraser)+$");
		if(p.matcher(s).find()) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}
}