import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String input=scanner.next();
		int length=input.length();

		while(length>0){
			if(length>=7 && input.substring(length-7,length).equals("dreamer")){
				length-=7;
			}else if(length>=6 && input.substring(length-6,length).equals("eraser")){
				length-=6;
			}else if(length>=5 && (input.substring(length-5,length).equals("dream") || input.substring(length-5,length).equals("erase"))){
				length-=5;
			}else{
				System.out.println("NO");
				break;
			}
		}
		if(length==0){
			System.out.println("YES");
		}
		scanner.close();
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String input=scanner.next();
		int length=input.length();

		while(length>0){
			if(length>=7 && input.substring(length-7,length).equals("dreamer")){
				length-=7;
			}else if(length>=6 && input.substring(length-6,length).equals("eraser")){
				length-=6;
			}else if(length>=5 && (input.substring(length-5,length).equals("dream") || input.substring(length-5,length).equals("erase"))){
				length-=5;
			}else{
				System.out.println("NO");
				break;
			}
		}
		if(length==0){
			System.out.println("YES");
		}
		scanner.close();
	}

} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String input=scanner.next();
		int length=input.length();

		while(length>0){
			if(length>=7 && input.substring(length-7,length).equals("dreamer")){
				length-=7;
			}else if(length>=6 && input.substring(length-6,length).equals("eraser")){
				length-=6;
			}else if(length>=5 && (input.substring(length-5,length).equals("dream") || input.substring(length-5,length).equals("erase"))){
				length-=5;
			}else{
				System.out.println("NO");
				break;
			}
		}
		if(length==0){
			System.out.println("YES");
		}
		scanner.close();
	} main {
		Scanner scanner = new Scanner(System.in);
		String input=scanner.next();
		int length=input.length();

		while(length>0){
			if(length>=7 && input.substring(length-7,length).equals("dreamer")){
				length-=7;
			}else if(length>=6 && input.substring(length-6,length).equals("eraser")){
				length-=6;
			}else if(length>=5 && (input.substring(length-5,length).equals("dream") || input.substring(length-5,length).equals("erase"))){
				length-=5;
			}else{
				System.out.println("NO");
				break;
			}
		}
		if(length==0){
			System.out.println("YES");
		}
		scanner.close();
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String input=scanner.next(); input scanner.next() scanner.next scanner int length=input.length(); length input.length() input.length input while(length>0){
			if(length>=7 && input.substring(length-7,length).equals("dreamer")){
				length-=7;
			}else if(length>=6 && input.substring(length-6,length).equals("eraser")){
				length-=6;
			}else if(length>=5 && (input.substring(length-5,length).equals("dream") || input.substring(length-5,length).equals("erase"))){
				length-=5;
			}else{
				System.out.println("NO");
				break;
			}
		} length>0 length 0 {
			if(length>=7 && input.substring(length-7,length).equals("dreamer")){
				length-=7;
			}else if(length>=6 && input.substring(length-6,length).equals("eraser")){
				length-=6;
			}else if(length>=5 && (input.substring(length-5,length).equals("dream") || input.substring(length-5,length).equals("erase"))){
				length-=5;
			}else{
				System.out.println("NO");
				break;
			}
		} if(length>=7 && input.substring(length-7,length).equals("dreamer")){
				length-=7;
			}else if(length>=6 && input.substring(length-6,length).equals("eraser")){
				length-=6;
			}else if(length>=5 && (input.substring(length-5,length).equals("dream") || input.substring(length-5,length).equals("erase"))){
				length-=5;
			}else{
				System.out.println("NO");
				break;
			} length>=7 && input.substring(length-7,length).equals("dreamer") length>=7 length 7 input.substring(length-7,length).equals("dreamer") input.substring(length-7,length).equals input.substring(length-7,length) input.substring input length-7 length 7 length "dreamer" {
				length-=7;
			} length-=7 length 7 if(length>=6 && input.substring(length-6,length).equals("eraser")){
				length-=6;
			}else if(length>=5 && (input.substring(length-5,length).equals("dream") || input.substring(length-5,length).equals("erase"))){
				length-=5;
			}else{
				System.out.println("NO");
				break;
			} length>=6 && input.substring(length-6,length).equals("eraser") length>=6 length 6 input.substring(length-6,length).equals("eraser") input.substring(length-6,length).equals input.substring(length-6,length) input.substring input length-6 length 6 length "eraser" {
				length-=6;
			} length-=6 length 6 if(length>=5 && (input.substring(length-5,length).equals("dream") || input.substring(length-5,length).equals("erase"))){
				length-=5;
			}else{
				System.out.println("NO");
				break;
			} length>=5 && (input.substring(length-5,length).equals("dream") || input.substring(length-5,length).equals("erase")) length>=5 length 5 (input.substring(length-5,length).equals("dream") || input.substring(length-5,length).equals("erase")) input.substring(length-5,length).equals("dream") input.substring(length-5,length).equals input.substring(length-5,length) input.substring input length-5 length 5 length "dream" input.substring(length-5,length).equals("erase") input.substring(length-5,length).equals input.substring(length-5,length) input.substring input length-5 length 5 length "erase" {
				length-=5;
			} length-=5 length 5 {
				System.out.println("NO");
				break;
			} System.out.println("NO") System.out.println System.out System System.out "NO" break; if(length==0){
			System.out.println("YES");
		} length==0 length 0 {
			System.out.println("YES");
		} System.out.println("YES") System.out.println System.out System System.out "YES" scanner.close() scanner.close scanner String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String input=scanner.next();
		int length=input.length();

		while(length>0){
			if(length>=7 && input.substring(length-7,length).equals("dreamer")){
				length-=7;
			}else if(length>=6 && input.substring(length-6,length).equals("eraser")){
				length-=6;
			}else if(length>=5 && (input.substring(length-5,length).equals("dream") || input.substring(length-5,length).equals("erase"))){
				length-=5;
			}else{
				System.out.println("NO");
				break;
			}
		}
		if(length==0){
			System.out.println("YES");
		}
		scanner.close();
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String input=scanner.next();
		int length=input.length();

		while(length>0){
			if(length>=7 && input.substring(length-7,length).equals("dreamer")){
				length-=7;
			}else if(length>=6 && input.substring(length-6,length).equals("eraser")){
				length-=6;
			}else if(length>=5 && (input.substring(length-5,length).equals("dream") || input.substring(length-5,length).equals("erase"))){
				length-=5;
			}else{
				System.out.println("NO");
				break;
			}
		}
		if(length==0){
			System.out.println("YES");
		}
		scanner.close();
	}

} Main
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String input=scanner.next();
		int length=input.length();

		while(length>0){
			if(length>=7 && input.substring(length-7,length).equals("dreamer")){
				length-=7;
			}else if(length>=6 && input.substring(length-6,length).equals("eraser")){
				length-=6;
			}else if(length>=5 && (input.substring(length-5,length).equals("dream") || input.substring(length-5,length).equals("erase"))){
				length-=5;
			}else{
				System.out.println("NO");
				break;
			}
		}
		if(length==0){
			System.out.println("YES");
		}
		scanner.close();
	}

}
