#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef tuple<ll, ll, ll> T;

string s;

int main(void){
    
    cin >> s;
    
    for(int i = s.size() - 1; i >= 0; --i){
        string temp = s.substr(i);
        if(temp == "dream" || temp == "dreamer" || temp == "erase" || temp == "eraser") s = s.substr(0, i);
    }
    printf("%s\n", (s.size()) ? "NO" : "YES");
    
    return 0;
}