
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.nextLine();
		
		List<String> terms = Arrays.asList("eraser", "erase", "dreamer", "dream");
		
		
		
		for(String tar : terms) {
			s = s.replaceAll(tar, "");
		}
		
		if(s.equals("") || s.isEmpty()) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
		
		
	}

} import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.List; List java.util 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.nextLine();
		
		List<String> terms = Arrays.asList("eraser", "erase", "dreamer", "dream");
		
		
		
		for(String tar : terms) {
			s = s.replaceAll(tar, "");
		}
		
		if(s.equals("") || s.isEmpty()) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
		
		
	}

} Main public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.nextLine();
		
		List<String> terms = Arrays.asList("eraser", "erase", "dreamer", "dream");
		
		
		
		for(String tar : terms) {
			s = s.replaceAll(tar, "");
		}
		
		if(s.equals("") || s.isEmpty()) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
		
		
	} main {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.nextLine();
		
		List<String> terms = Arrays.asList("eraser", "erase", "dreamer", "dream");
		
		
		
		for(String tar : terms) {
			s = s.replaceAll(tar, "");
		}
		
		if(s.equals("") || s.isEmpty()) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
		
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc List<String> terms = Arrays.asList("eraser", "erase", "dreamer", "dream"); terms Arrays.asList("eraser", "erase", "dreamer", "dream") Arrays.asList Arrays "eraser" "erase" "dreamer" "dream" for(String tar : terms) {
			s = s.replaceAll(tar, "");
		} String tar terms {
			s = s.replaceAll(tar, "");
		} {
			s = s.replaceAll(tar, "");
		} s = s.replaceAll(tar, "") s s.replaceAll(tar, "") s.replaceAll s tar "" if(s.equals("") || s.isEmpty()) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		} s.equals("") || s.isEmpty() s.equals("") s.equals s "" s.isEmpty() s.isEmpty 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 {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.nextLine();
		
		List<String> terms = Arrays.asList("eraser", "erase", "dreamer", "dream");
		
		
		
		for(String tar : terms) {
			s = s.replaceAll(tar, "");
		}
		
		if(s.equals("") || s.isEmpty()) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
		
		
	}

} public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.nextLine();
		
		List<String> terms = Arrays.asList("eraser", "erase", "dreamer", "dream");
		
		
		
		for(String tar : terms) {
			s = s.replaceAll(tar, "");
		}
		
		if(s.equals("") || s.isEmpty()) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
		
		
	}

} Main

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.nextLine();
		
		List<String> terms = Arrays.asList("eraser", "erase", "dreamer", "dream");
		
		
		
		for(String tar : terms) {
			s = s.replaceAll(tar, "");
		}
		
		if(s.equals("") || s.isEmpty()) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
		
		
	}

}
