import java.util.*;
//import java.util.stream.Collectors;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		boolean b = true;
		while(s.length() != 0){
			if(s.endsWith("dream") || s.endsWith("erase")){
				s = s.substring(0, s.length() - 5);
			}else if(s.endsWith("eraser")){
				s = s.substring(0, s.length() - 6);
			}else if(s.endsWith("dreamer")){
				s = s.substring(0, s.length() - 7);
			}else{
				b = false;
				break;
			}
		}
		System.out.println(b ? "YES" : "NO");
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		boolean b = true;
		while(s.length() != 0){
			if(s.endsWith("dream") || s.endsWith("erase")){
				s = s.substring(0, s.length() - 5);
			}else if(s.endsWith("eraser")){
				s = s.substring(0, s.length() - 6);
			}else if(s.endsWith("dreamer")){
				s = s.substring(0, s.length() - 7);
			}else{
				b = false;
				break;
			}
		}
		System.out.println(b ? "YES" : "NO");
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		boolean b = true;
		while(s.length() != 0){
			if(s.endsWith("dream") || s.endsWith("erase")){
				s = s.substring(0, s.length() - 5);
			}else if(s.endsWith("eraser")){
				s = s.substring(0, s.length() - 6);
			}else if(s.endsWith("dreamer")){
				s = s.substring(0, s.length() - 7);
			}else{
				b = false;
				break;
			}
		}
		System.out.println(b ? "YES" : "NO");
	} main {
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		boolean b = true;
		while(s.length() != 0){
			if(s.endsWith("dream") || s.endsWith("erase")){
				s = s.substring(0, s.length() - 5);
			}else if(s.endsWith("eraser")){
				s = s.substring(0, s.length() - 6);
			}else if(s.endsWith("dreamer")){
				s = s.substring(0, s.length() - 7);
			}else{
				b = false;
				break;
			}
		}
		System.out.println(b ? "YES" : "NO");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc boolean b = true; b true while(s.length() != 0){
			if(s.endsWith("dream") || s.endsWith("erase")){
				s = s.substring(0, s.length() - 5);
			}else if(s.endsWith("eraser")){
				s = s.substring(0, s.length() - 6);
			}else if(s.endsWith("dreamer")){
				s = s.substring(0, s.length() - 7);
			}else{
				b = false;
				break;
			}
		} s.length() != 0 s.length() s.length s 0 {
			if(s.endsWith("dream") || s.endsWith("erase")){
				s = s.substring(0, s.length() - 5);
			}else if(s.endsWith("eraser")){
				s = s.substring(0, s.length() - 6);
			}else if(s.endsWith("dreamer")){
				s = s.substring(0, s.length() - 7);
			}else{
				b = false;
				break;
			}
		} if(s.endsWith("dream") || s.endsWith("erase")){
				s = s.substring(0, s.length() - 5);
			}else if(s.endsWith("eraser")){
				s = s.substring(0, s.length() - 6);
			}else if(s.endsWith("dreamer")){
				s = s.substring(0, s.length() - 7);
			}else{
				b = false;
				break;
			} s.endsWith("dream") || s.endsWith("erase") s.endsWith("dream") s.endsWith s "dream" s.endsWith("erase") s.endsWith s "erase" {
				s = s.substring(0, s.length() - 5);
			} s = s.substring(0, s.length() - 5) s s.substring(0, s.length() - 5) s.substring s 0 s.length() - 5 s.length() s.length s 5 if(s.endsWith("eraser")){
				s = s.substring(0, s.length() - 6);
			}else if(s.endsWith("dreamer")){
				s = s.substring(0, s.length() - 7);
			}else{
				b = false;
				break;
			} s.endsWith("eraser") s.endsWith s "eraser" {
				s = s.substring(0, s.length() - 6);
			} s = s.substring(0, s.length() - 6) s s.substring(0, s.length() - 6) s.substring s 0 s.length() - 6 s.length() s.length s 6 if(s.endsWith("dreamer")){
				s = s.substring(0, s.length() - 7);
			}else{
				b = false;
				break;
			} s.endsWith("dreamer") s.endsWith s "dreamer" {
				s = s.substring(0, s.length() - 7);
			} s = s.substring(0, s.length() - 7) s s.substring(0, s.length() - 7) s.substring s 0 s.length() - 7 s.length() s.length s 7 {
				b = false;
				break;
			} b = false b false break; System.out.println(b ? "YES" : "NO") System.out.println System.out System System.out b ? "YES" : "NO" b "YES" "NO" String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		boolean b = true;
		while(s.length() != 0){
			if(s.endsWith("dream") || s.endsWith("erase")){
				s = s.substring(0, s.length() - 5);
			}else if(s.endsWith("eraser")){
				s = s.substring(0, s.length() - 6);
			}else if(s.endsWith("dreamer")){
				s = s.substring(0, s.length() - 7);
			}else{
				b = false;
				break;
			}
		}
		System.out.println(b ? "YES" : "NO");
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		boolean b = true;
		while(s.length() != 0){
			if(s.endsWith("dream") || s.endsWith("erase")){
				s = s.substring(0, s.length() - 5);
			}else if(s.endsWith("eraser")){
				s = s.substring(0, s.length() - 6);
			}else if(s.endsWith("dreamer")){
				s = s.substring(0, s.length() - 7);
			}else{
				b = false;
				break;
			}
		}
		System.out.println(b ? "YES" : "NO");
	}
} Main
import java.util.*;
//import java.util.stream.Collectors;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		boolean b = true;
		while(s.length() != 0){
			if(s.endsWith("dream") || s.endsWith("erase")){
				s = s.substring(0, s.length() - 5);
			}else if(s.endsWith("eraser")){
				s = s.substring(0, s.length() - 6);
			}else if(s.endsWith("dreamer")){
				s = s.substring(0, s.length() - 7);
			}else{
				b = false;
				break;
			}
		}
		System.out.println(b ? "YES" : "NO");
	}
}
