#include<iostream>
#include<cstring>
using namespace std;
bool f[101010];
char s[101010];
int num[10];
char a[5][10]={
	"         ",
	" dream   ",
	" dreamer ",
	" erase   ",
	" eraser  "};
int main()
{
	num[1]=5;
	num[2]=7;
	num[3]=5;
	num[4]=6;
	cin>>s+1;
	f[0]=1;
	int n=strlen(s+1);
	for(int i=0;i<n;i++)
	if(f[i]==1)
	{
		for(int j=1;j<=4;j++)
		{
			bool flag=0;
			for(int k=1;k<=num[j];k++)
			if(s[i+k]!=a[j][k])
			{
				flag=1;
				break;
			}
			if(flag==0)
				f[i+num[j]]=1;
		}
	}
	if(f[n]==1)
		cout<<"YES"<<endl;
	else
		cout<<"NO"<<endl;
	return 0;
}