process.stdin.resume();
process.stdin.setEncoding('ascii');

var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;

process.stdin.on('data', function (data) {
    input_stdin += data;
});

process.on('SIGINT', function(){
    input_stdin_array = input_stdin.split("\n");
    main();
    process.exit();
});

process.stdin.on('end', function () {
    input_stdin_array = input_stdin.split("\n");
    main();    
});

function readLine() {
    return input_stdin_array[input_currentline++];
}

/////////////// ignore above this line ////////////////////

function reverse(cad){
	var ret='';
	for (var i = cad.length-1; i>=0; i--)
		ret+=cad[i];
	return ret;
}

function main() {
	var s = readLine();
	/*eliminating \r , this is only for windows*/
	/*s = s.substr(0,s.length-1);*/
	
	s = reverse(s);
	while (s.length > 0){
		t=s.substr(0,5);
		r=s.substr(0,6);
		y=s.substr(0,7);
		if (t.localeCompare('maerd') == 0){
			s = s.substr(5);
		} else if (t.localeCompare('esare') == 0){
			s = s.substr(5);
		} else if (r.localeCompare('resare') == 0){
			s = s.substr(6);
		} else if (y.localeCompare('remaerd') == 0){
			s = s.substr(7);
		} else {
			break;
		}
	}
	
	if (s.length == 0){
		console.log("YES");
	} else {
		console.log("NO");
	}
}
