#include <iostream>
#include <vector>
#include <algorithm>
#include <regex>
using namespace std;
typedef long long ll;
int inf = 1<<29;
int main(void){
    string s;cin >> s;
    if(regex_match(s,regex("(dream(er)?|eraser?)*"))) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}
