#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main() {
	string S;
	cin >> S;
	reverse(S.begin(), S.end());

	int i = 0;
	while(i < S.size()) {
		if(S.substr(i, 5) == "maerd") i += 5;
		else if(S.substr(i, 7) == "remaerd") i += 7;
		else if(S.substr(i, 5) == "esare") i += 5;
		else if(S.substr(i, 6) == "resare") i+= 6;
		else { cout << "NO" << endl; return 0; }
	}

	cout << "YES" << endl;

	return 0;
}
