import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String ans = S.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", "");
		System.out.println(ans.equals("") ? "YES" :"NO");
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String ans = S.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", "");
		System.out.println(ans.equals("") ? "YES" :"NO");
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String ans = S.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", "");
		System.out.println(ans.equals("") ? "YES" :"NO");
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String ans = S.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", "");
		System.out.println(ans.equals("") ? "YES" :"NO");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc String ans = S.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", ""); ans 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" "" System.out.println(ans.equals("") ? "YES" :"NO") System.out.println System.out System System.out ans.equals("") ? "YES" :"NO" ans.equals("") ans.equals ans "" "YES" "NO" String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String ans = S.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", "");
		System.out.println(ans.equals("") ? "YES" :"NO");
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String ans = S.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", "");
		System.out.println(ans.equals("") ? "YES" :"NO");
	}
} Main
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String ans = S.replace("eraser", "")
				.replace("erase", "")
				.replace("dreamer", "")
				.replace("dream", "");
		System.out.println(ans.equals("") ? "YES" :"NO");
	}
}