import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		if(br.readLine( ).matches("^((dreamer)|(eraser)|(dream)|(erase))+$") ){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		if(br.readLine( ).matches("^((dreamer)|(eraser)|(dream)|(erase))+$") ){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		if(br.readLine( ).matches("^((dreamer)|(eraser)|(dream)|(erase))+$") ){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		if(br.readLine( ).matches("^((dreamer)|(eraser)|(dream)|(erase))+$") ){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) if(br.readLine( ).matches("^((dreamer)|(eraser)|(dream)|(erase))+$") ){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		} br.readLine( ).matches("^((dreamer)|(eraser)|(dream)|(erase))+$") br.readLine( ).matches br.readLine( ) br.readLine br "^((dreamer)|(eraser)|(dream)|(erase))+$" {
			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) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		if(br.readLine( ).matches("^((dreamer)|(eraser)|(dream)|(erase))+$") ){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		if(br.readLine( ).matches("^((dreamer)|(eraser)|(dream)|(erase))+$") ){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		if(br.readLine( ).matches("^((dreamer)|(eraser)|(dream)|(erase))+$") ){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
}