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

#include <cstdlib>

#include <algorithm>

#include <cstring>



const int maxn = 1e5 + 20;



char s[maxn];

int n;

bool flag[maxn];

char ch[4][10] = {"dream", "dreamer", "erase", "eraser"};

int len[4] = {5, 7, 5, 6};



bool check(char *s1, char *s2, int l)

{

	for(int i = 0; i < l; i++)

	{

		if(s1[i] != s2[i]) return false;

	}

	

	return true;

}

int main()

{

	scanf("%s", s + 1);

	n = strlen(s + 1);

	

	flag[0] = true;

	for(int i = 1; i <= n; i++)

	{

		for(int j = 0; j < 4; j++)

		{

			if(i - len[j] >= 0 && flag[i - len[j]] && check(s + (i - len[j] + 1), ch[j], len[j]))

			{

				flag[i] = true;

				break;

			}

		}

	}

	

	puts(flag[n] ? "YES" : "NO");

	

	return 0;

}