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