// Slower C++ solution:
#include <iostream>

#include <string>

#include <vector>

#include <algorithm>

#include <stack>

#include <queue>

#include <cmath>

#include <tuple>

#include <cstdio>

#include <bitset>

#include <sstream>

#include <iterator>

#include <numeric>

#include <map>

#include <cstring>

#include <set>



using namespace std;



//#define DEBUG_ //!!提出時にコメントアウト!!

#ifdef DEBUG_

	#define dump(x)  cerr << #x << " = " << (x) << endl;

#else

	#define dump(x)  ; //何もしない文

#endif



#define FOR(i,a,b) for(int i=(a);i<(b);++i)

#define REP(i,n)  FOR(i,0,n)

#define SZ(x) ((int)(x).size()) //unsignedのサイズをint型に変換

#define pb push_back



//#define int long long



typedef long long LL;

typedef vector<int> VI;

typedef vector<VI> VVI;

typedef vector<string> VS;

typedef pair<int, int> PII;

typedef pair<LL, LL> PLL;



template <typename T>

std::string printVector(const std::vector<T> &data)

{

    std::stringstream ss;

    std::ostream_iterator<T> out_it(ss, ", ");

    ss << "[";

    std::copy(data.begin(), data.end() - 1, out_it);

    ss << data.back() << "]";

    return ss.str();

}



const int MOD = 1e9+7;

const LL LINF = 1001002003004005006ll;

const int INF = 1001001001;



signed main(int argc, char const *argv[])

{

    cin.tie(0);

    ios::sync_with_stdio(false);

    string S; cin>>S;

    int ok[101010] = {};

    ok[0] = 1;

    int L = S.size();

    REP(i,L) if(ok[i])

    {

        if(i+5 <= L && S.substr(i,5) == "dream") ok[i+5] = 1;

        if(i+7 <= L && S.substr(i,7) == "dreamer") ok[i+7] = 1;

        if(i+5 <= L && S.substr(i,5) == "erase") ok[i+5] = 1;

        if(i+6 <= L && S.substr(i,6) == "eraser") ok[i+6] = 1;



    }

    if(ok[L] == 1) cout << "YES" << endl;

    else cout << "NO" << endl;

    dump(L)



    REP(i,20)

    {

        dump(i)

        dump(ok[i])

    }





}

// Faster C++ solution for the same problem (measured speedup: 1.3977298968947758x):
#include <iostream>

#include <string>

#include <vector>

#include <algorithm>

#include <stack>

#include <queue>

#include <cmath>

#include <tuple>

#include <cstdio>

#include <bitset>

#include <sstream>

#include <iterator>

#include <numeric>

#include <map>

#include <cstring>

#include <set>



using namespace std;



//#define DEBUG_ //!!提出時にコメントアウト!!

#ifdef DEBUG_

	#define dump(x)  cerr << #x << " = " << (x) << endl;

#else

	#define dump(x)  ; //何もしない文

#endif



#define FOR(i,a,b) for(int i=(a);i<(b);++i)

#define REP(i,n)  FOR(i,0,n)

#define SZ(x) ((int)(x).size()) //unsignedのサイズをint型に変換

#define pb push_back



//#define int long long



typedef long long LL;

typedef vector<int> VI;

typedef vector<VI> VVI;

typedef vector<string> VS;

typedef pair<int, int> PII;

typedef pair<LL, LL> PLL;



template <typename T>

std::string printVector(const std::vector<T> &data)

{

    std::stringstream ss;

    std::ostream_iterator<T> out_it(ss, ", ");

    ss << "[";

    std::copy(data.begin(), data.end() - 1, out_it);

    ss << data.back() << "]";

    return ss.str();

}



const int MOD = 1e9+7;

const LL LINF = 1001002003004005006ll;

const int INF = 1001001001;



signed main(int argc, char const *argv[])

{

    cin.tie(0);

    ios::sync_with_stdio(false);

    string S; cin >> S;

    int p = SZ(S);

    while(1)

    {

        dump(p)

        if(p == 0)

        {

            cout << "YES" << endl;

            return 0;

        }



        dump(S.substr(p-5,5))



        if(S.substr(p-5,5) == "dream")

        {

            p -= 5;

            continue;

        }

        if(p-7 >= 0 && S.substr(p-7,7) == "dreamer")

        {

            p -= 7;

            continue;

        }

        if(S.substr(p-5,5) == "erase")

        {

            p -= 5;

            continue;

        }

        if(p-6 >= 0 && S.substr(p-6,6) == "eraser")

        {

            p -= 6;

            continue;

        }



        cout << "NO" << endl;

        return 0;









    }



}