#include <iostream>
#include <string>
using namespace std;

int main() {
    string s;
    string li[] = {"maerd", "remaerd", "esare", "resare"};
    cin >> s;
    string t = "";
    for(int i = s.size()-1; i >= 0; --i) {
        t += s[i];
        for(int j = 0; j < 4; ++j) {
          if(t == li[j]) t = "";
        }
    }
    if(t == "") cout << "YES" << endl;
    else cout << "NO" << endl;

    return 0;
}