// C - 白昼夢 / Daydream
#include <bits/stdc++.h>
using namespace std;

int main(){
	vector<string> T{"dreamer","eraser","erase","dream",};
	for(auto &p:T){ reverse(p.begin(), p.end()); }

	string s; cin>>s;
	reverse(s.begin(), s.end());

	string ans;
	int i = 0;
	while(i<s.size()){
		ans = "NO";
		int j;
		for(j=0; j<4; ++j){
			if(T[j]==s.substr(i,T[j].size())){
				ans="YES";
				break;
			}
		}
		if(ans=="NO") break;
		i += T[j].size();
	}
	cout<< ans <<endl;

}