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

#include<cstring>

using namespace std;

char s[100005];

int dp[100005],len;

int f(int n){

	if (dp[n]) return 1;

	if (n<5) return 0;

	char tmp[10];

	for (int i=0; i<5; i++) tmp[i]=s[i+n-5];

	tmp[5]='\0';

	if (strcmp(tmp,"dream")==0&&f(n-5)) return 1;

	else if (strcmp(tmp,"erase")==0&&f(n-5)) return 1;

	if (n<6) return 0;

	for (int i=0; i<6; i++) tmp[i]=s[i+n-6];

	tmp[6]='\0';

	if (strcmp(tmp,"eraser")==0&&f(n-6)) return 1;	

	if (n<7) return 0;

	for (int i=0; i<7; i++) tmp[i]=s[i+n-7];

	tmp[7]='\0';

	if (strcmp(tmp,"dreamer")==0&&f(n-7)) return 1;

	return 0;	

}

int main(){

	scanf("%s",s);

	len=strlen(s);

	dp[0]=1;

	for (int i=1; i<=len; i++) dp[i]=0;

	if (f(len)) printf("YES\n");

	else printf("NO\n");

	return 0;

}