#include "bits/stdc++.h"

using namespace std;

int main() {
	string s;
	cin >> s;
	string tmp = "";
	set<string> se;
	for(int i = s.length() - 1; i >= 0; --i){
        tmp += s[i];
        if(tmp == "maerd" || tmp == "remaerd" || tmp == "esare" || tmp == "resare"){
            reverse(tmp.begin(), tmp.end());
            se.insert(tmp);
            tmp = "";
        }
	}
	if(tmp.length() == 0 && s.size() >= 1)cout << "YES";
	else cout << "NO";
	return 0;

}
