// Slower C++ solution:
/*

By Snickeen

*/

#include<bits/stdc++.h>

//#pragma comment(linker, "/STACK:102400000,102400000")

#include <stdio.h>

#include <iostream>

#include <iomanip>

#include <fstream>

#include <string.h>

#include <stdlib.h>

#include <time.h>

#include <limits.h>

#include <math.h>

#include <algorithm>

#include <deque>

#include <queue>

#include <stack>

#include <list>

#include <map>

#include <set>

#include <utility>

#include <sstream>

#include <complex>

#include <string>

#include <vector>

#include <bitset>

#include <functional>

using namespace std;

typedef long long LL;

typedef unsigned long long ULL;

typedef double db;

typedef long double ldb;

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

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

#define repd(i,a,b) for(i=a;i>=b;i--)

#define repc(i,a,b,c) for(i=a;i<b;i+=c)

#define repcu(i,a,b,c) for(i=a;i<=b;i+=c)

#define repcd(i,a,b,c) for(i=a;i>=b;i-=c)

#define FIN freopen("input.in","r",stdin)

#define FOUT freopen("output.out","w",stdout)

#define CC(a) memset(a,0,sizeof(a))

#define MST(a,b) memset(a,b,sizeof(a))

#define PII pair<int,int>

#define PLL pair<LL,LL>

#define VI vector<int>

#define VL vector<LL>

#define VII vector<PII >

#define VLL vector<PLL >

#define all(x) x.begin(),x.end()

#define mp make_pair

#define pb push_back

#define pf push_front

#define FF first

#define SS second



template<typename T>inline void gn(T &x){

	x=0;T f=1;char ch=getchar();

	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}

	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}

	x*=f;

}

template<typename T>inline void gt(T x){

	if(!x)return;

	gt(x/10);putchar(x%10+'0');

}

 

const LL MAXN=1e5+10;

LL t,n,m,ans;

LL MOD=1e9+7,inf=0x1f1f1f1f;

db eps=1e-5;



string s,s1,s2;

LL len;

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



LL check(LL x){

	LL i,j,k,l;

	l=ss[x].size();

	s1="";

	for(i=s.size()-1,j=0;j<l&&i>=0;j++,i--){

		s1+=s[i];

	}

	reverse(all(s1));

//	cout<<l<<" "<<s1<<endl;

	repu(i,0,3){

		if(s1==ss[i])return 1;

	}

	return 0;

}



int main()

{

//	ios_base::sync_with_stdio(false);cin.tie(0);

	LL i,j,k,l,ca=0;

	cin>>s;

	len=l=s.size();

	//reverse(all(s));

	while(s.size()){

		k=0;

		repu(i,0,3){

			if(s.size()<ss[i].size())continue;

			if(check(i)){

				k=1;

				j=ss[i].size();

				s.erase(s.size()-j,j);

//				cout<<s.size()<<" "<<j<<" "<<s<<endl;

				break;

			}

		}

		if(k==0)return cout<<"NO"<<endl,0;

	}

	cout<<"YES"<<endl;

	return 0;

}

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

#include<cstring>

#include<cmath>

#include<algorithm>

using namespace std;

int main(){

    char a[100005];

    int n,j,i;

    while(~scanf("%s",a)){

        n=strlen(a);i=0;

        while(i<n){

            if(a[i]=='d'&&a[i+1]=='r'&&a[i+2]=='e'&&a[i+3]=='a'&&a[i+4]=='m'){

                if(a[i+5]=='e'&&a[i+6]=='r'&&(a[i+7]=='e'||a[i+7]=='d'||a[i+7]=='\0')){

                    i=i+7;

                }

                else{

                    i=i+5;

                }

            }

            else if(a[i]=='e'&&a[i+1]=='r'&&a[i+2]=='a'&&a[i+3]=='s'&&a[i+4]=='e'){

                if(a[i+5]=='r'){

                    i=i+6;

                }

                else{

                    i=i+5;

                }

            }

            else{

                break;

            }

        }

        if(i>=n){

            printf("YES\n");

        }

        else{

            printf("NO\n");

        }

    }

    return 0;

}