#include "bits/stdc++.h"
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
const LL MOD = 1000000007LL;
int main() {
	string S;
	cin >> S;
	reverse(S.begin(), S.end());
	string words[] = { "dream","dreamer","erase","eraser" };
	for (int i = 0; i < 4; i++) reverse(words[i].begin(), words[i].end());
	int pos = 0;
	while (pos < S.size()) {
		bool NG = 1;
		for (int i = 0; i < 4; i++) {
			if (pos + words[i].size() <= S.size() && S.substr(pos, words[i].size()) == words[i]) {
				pos += words[i].size();
				NG = 0;
				break;
			}
		}
		if (NG) {
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;
}