// 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.377168090931816x):
#include <cstdio>

#include <cstring>

#include <algorithm>

int  a,b,c,d,i,j,k,x,y,z,ans;

char f[100005];

int main(){

	scanf("%s",f);

	c=0;

	while (true){

		d=c+4;

		if ((f[c]=='d') and (f[c+1]=='r') and (f[c+2]=='e') and (f[c+3]=='a') and (f[c+4]=='m')){

			if (d==strlen(f)-1){

				printf("YES\n");

				return 0;

			}

			else if (d==strlen(f)-3){

				if ((f[d+1]=='e') and (f[d+2]=='r')){

					printf("YES\n");

					return 0;	

				}

				else {

					printf("NO\n");

					return 0;					

				}

			}

			else if ((f[d+1]=='e') and (f[d+2]=='r')){

				if (f[d+3]=='a') c+=5; else c+=7;

			}

			else {

				c+=5;

			}

		}

		else if ((f[c]=='e') and (f[c+1]=='r') and (f[c+2]=='a') and (f[c+3]=='s') and (f[c+4]=='e')){

			if (d==strlen(f)-1){

				printf("YES\n");

				return 0;

			}

			else if (d==strlen(f)-2){

				if (f[d+1]=='r'){

					printf("YES\n");

					return 0;	

				}

				else {

					printf("NO\n");

					return 0;					

				}

			}

			else if (f[d+1]=='r') c+=6;

			else {

				c+=5;

			}

		}

		else {

			printf("NO\n");

			return 0;					

		}

	}

}