#include<bits/stdc++.h>
#define rep(i,a,n) for (int i = a;i < n;i++)
#define per(i,n,a) for (int i = n-1;i >= a;i--)
using namespace std;

int main() {
    string s;
    cin >> s;
    if (regex_match(s, regex("(dream|dreamer|erase|eraser)*")))
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
}