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

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader input =new BufferedReader (new InputStreamReader (System.in));
		String str = input.readLine( );

			if(str.matches("^((dreamer)|(eraser)|(dream)|(erase))+$") ){
				System.out.println("YES");
			}else{
				System.out.println("NO");
				System.exit(0);
			}
		}

} 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 input =new BufferedReader (new InputStreamReader (System.in));
		String str = input.readLine( );

			if(str.matches("^((dreamer)|(eraser)|(dream)|(erase))+$") ){
				System.out.println("YES");
			}else{
				System.out.println("NO");
				System.exit(0);
			}
		}

} Main public static void main(String[] args) throws IOException {
		BufferedReader input =new BufferedReader (new InputStreamReader (System.in));
		String str = input.readLine( );

			if(str.matches("^((dreamer)|(eraser)|(dream)|(erase))+$") ){
				System.out.println("YES");
			}else{
				System.out.println("NO");
				System.exit(0);
			}
		} main {
		BufferedReader input =new BufferedReader (new InputStreamReader (System.in));
		String str = input.readLine( );

			if(str.matches("^((dreamer)|(eraser)|(dream)|(erase))+$") ){
				System.out.println("YES");
			}else{
				System.out.println("NO");
				System.exit(0);
			}
		} BufferedReader input =new BufferedReader (new InputStreamReader (System.in)); input new BufferedReader (new InputStreamReader (System.in)) String str = input.readLine( ); str input.readLine( ) input.readLine input if(str.matches("^((dreamer)|(eraser)|(dream)|(erase))+$") ){
				System.out.println("YES");
			}else{
				System.out.println("NO");
				System.exit(0);
			} str.matches("^((dreamer)|(eraser)|(dream)|(erase))+$") str.matches str "^((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.exit(0);
			} System.out.println("NO") System.out.println System.out System System.out "NO" System.exit(0) System.exit System 0 String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader input =new BufferedReader (new InputStreamReader (System.in));
		String str = input.readLine( );

			if(str.matches("^((dreamer)|(eraser)|(dream)|(erase))+$") ){
				System.out.println("YES");
			}else{
				System.out.println("NO");
				System.exit(0);
			}
		}

} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader input =new BufferedReader (new InputStreamReader (System.in));
		String str = input.readLine( );

			if(str.matches("^((dreamer)|(eraser)|(dream)|(erase))+$") ){
				System.out.println("YES");
			}else{
				System.out.println("NO");
				System.exit(0);
			}
		}

} 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 input =new BufferedReader (new InputStreamReader (System.in));
		String str = input.readLine( );

			if(str.matches("^((dreamer)|(eraser)|(dream)|(erase))+$") ){
				System.out.println("YES");
			}else{
				System.out.println("NO");
				System.exit(0);
			}
		}

}
