// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define ll long long

#define pb push_back

const int maxn =1e5+10;

const int mod=20100501;











int main()

{

    ios::sync_with_stdio(false);

    cin.tie(0);

    string s;

    s.resize(maxn);

    cin>>s;

    string a="dream";

    string b="dreamer";

    string c="erase";

    string d="eraser";

    int n=s.size();

    for(int i=0;i<n;)

    {

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

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

        if(f==d)

        {

            i+=6;

            continue;

        }

        if(e==c)

        {

            i+=5;

            continue;

        }

        if(e==a)

        {

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

            if(g==b)

            {

                if(s[i+7]=='a')

                {

                    i+=5;

                    continue;

                }

                else

                {

                    i+=7;

                    continue;

                }

            }

            else

            {

                i+=5;

                continue;

            }

        }



        cout<<"NO"<<'\n';

        return 0;

    }

    cout<<"YES"<<'\n';









}


// Faster C++ solution for the same problem (measured speedup: 1.097480235537866x):
/*

dreamerer

*/

#include <bits/stdc++.h>

using namespace std; using ll = long long; using ld = long double; using pii = pair<int, int>; const int N = 5e5 + 5, M = 998244353, INF = 0x3f3f3f3f; const ll LNF = 0x3f3f3f3f3f3f3f3f; void Main();

void debug() { cerr << endl; } template <typename T, typename... Ts> void debug(T x, Ts... y) { cerr << "\033[31m" << x << "\033[0m"; if (sizeof...(y) > 0) cerr << ' '; debug(y...); } template <typename T> void debug(const T& a, int l, int r, char c) { for (int i = l; i <= r; ++i) cerr << "\033[31m" << a[i] << "\033[0m" << (i == r ? '\n' : c); }

void print() { cout << '\n'; } template <typename T, typename... Ts> void print(T x, Ts... y) { cout << x; if (sizeof...(y) > 0) cout << ' '; print(y...); } template <typename T> void print(const T& a, int l, int r, char c) { for (int i = l; i <= r; ++i) cout << a[i] << (i == r ? '\n' : c); }

void input() {} template <typename T, typename... Ts> void input(T& x, Ts&... y) { cin >> x; input(y...); } template <typename T> void input(T* a, int l, int r) { for (int i = l; i <= r; ++i) cin >> a[i]; } template <typename T> void input(vector<T>& a, int l, int r) { for (int i = l; i <= r; ++i) cin >> a[i]; }

template <typename T> void Max(T& a, T b) { if (a < b) a = b; } template <typename T> void Min(T& a, T b) { if (a > b) a = b; } template <typename T> void Add(T& a, T b) { a += b; if (a > M) a -= M; if (a < 0) a += M; } template <typename T> void Mul(T& a, T b) { a = a * b % M; } template <typename T> T Mod(T a) { return (a % M + M) % M; }

int main(int argc, char** argv) {

    ios::sync_with_stdio(0); cin.tie(0); /* cout << setprecision(10) << fixed; */

#ifdef Zmm

    if (argc) { freopen((string(*(argv)).substr(2, string(*(argv)).size() - 6) + string(".cpp")).c_str(), "r", stdin); string x; cin >> x; }

#endif

    Main();

}



void Main() {

    vector<string> T = {"dreamer", "dream", "eraser", "erase"};

    for (string& t : T) reverse(t.begin(), t.end());

    string s;

    input(s);

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

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

        for (string& t : T) if (s.substr(i, t.size()) == t) {

            i += t.size();

            goto l1;

        }

        print("NO");

        return;

        l1:;

    }

    print("YES");

}