// Original C++ solution (slower):
/*

ID: y1197771

PROG: test

LANG: C++

*/

#include<bits/stdc++.h>

#define pb push_back

#define FOR(i, n) for (int i = 0; i < (int)n; ++i)

#define dbg(x) cout << #x << " at line " << __LINE__ << " is: " << x << endl

typedef long long ll;

using namespace std;

typedef pair<int, int> pii;

const int maxn = 1e5 + 10;

string a[] = {"dream", "dreamer", "erase", "eraser"};

int dp[maxn];

void solve() {

    string s;

    cin >> s;

    memset(dp, 0, sizeof dp);

    dp[0] = 1;

    for (int i = 1; i <= s.size(); i++) {

        for (int j = 0; j < 4; j++) {

            int sz = a[j].size();

            if(i - sz>= 0) {

                string t = s.substr(i - sz, sz);

                //cout << i << " " << t << endl;

                if(t == a[j] && dp[i - sz]) {

                    dp[i] = 1;

                    //cout << i << " " << t << endl;

                }

            }

        }

    }

    if(dp[s.size()])

        cout << "YES" << endl;

    else cout << "NO" << endl;

}

int main() {

   // freopen("test.in", "r", stdin);

    //freopen("test.out", "w", stdout);

    ios::sync_with_stdio(0);

    cin.tie(0); cout.tie(0);

    //int _; _ = 3;

    //while(_--)

    solve();

    return 0;

}


// Optimized solution to the same problem (faster):
/*

ID: y1197771

PROG: test

LANG: C++

*/

#include<bits/stdc++.h>

#define pb push_back

#define FOR(i, n) for (int i = 0; i < (int)n; ++i)

#define dbg(x) cout << #x << " at line " << __LINE__ << " is: " << x << endl

typedef long long ll;

using namespace std;

typedef pair<int, int> pii;

const int maxn = 1e3 + 10;

string s = "aeiou";

void yes() {

    cout << "YES" << endl;

}

void no() {

    cout << "NO" << endl;

}

void solve() {

    while(cin >> s) {

        int n = s.size();

        int i = 0;

        reverse(s.begin(), s.end());

        bool f = 1;

        while(i < n) {

            if(s[i] == 'm') {

                if(i + 5 <= n) {

                    string t = s.substr(i, 5);

                    if(t == "maerd") {

                        i += 5;

                    } else {

                        f = 0;

                        break;

                    }

                } else {

                    f = 0; break;

                }

                continue;

            }

            if(s[i] == 'r') {

                if(i + 6 <= n) {

                    string t = s.substr(i, 6);

                    if(t == "resare") {

                        i += 6;

                        continue;

                    }

                }

                if(i + 7 <= n) {

                    string t = s.substr(i, 7);

                    if(t == "remaerd") {

                        i += 7;

                        continue;

                    }

                }

                f = 0;

                break;

            }

            if(s[i] == 'e') {

                if(i + 5 <= n) {

                    string t = s.substr(i, 5);

                    if(t == "esare") {

                        i += 5;

                    } else {

                        f = 0; break;

                    }

                } else {

                    f = 0; break;

                }

                continue;

            }

            f = 0;

            break;

        }

        if(f) yes();

        else no();

    }

}

int main() {

    //freopen("test.in", "r", stdin);

    //freopen("test.out", "w", stdout);

    ios::sync_with_stdio(0);

    cin.tie(0); cout.tie(0);

    solve();

    return 0;

}


// Fastest known solution for this problem: