#include<bits/stdc++.h>
#define N 222222
#define LL long long
using namespace std;
int T,n,i;bool f[N];char s[N];
int main(){
	scanf("%s",s+1);
	n=strlen(s+1);f[0]=1;
	for(i=5;i<=n;i++){
		if(s[i-4]=='d'&&s[i-3]=='r'&&s[i-2]=='e'&&s[i-1]=='a'&&s[i]=='m'&&f[i-5])f[i]=1;
		if(s[i-4]=='e'&&s[i-3]=='r'&&s[i-2]=='a'&&s[i-1]=='s'&&s[i]=='e'&&f[i-5])f[i]=1;
		if(i>5)if(s[i-5]=='e'&&s[i-4]=='r'&&s[i-3]=='a'&&s[i-2]=='s'&&s[i-1]=='e'&&s[i]=='r'&&f[i-6])f[i]=1;
		if(i>6)if(s[i-6]=='d'&&s[i-5]=='r'&&s[i-4]=='e'&&s[i-3]=='a'&&s[i-2]=='m'&&s[i-1]=='e'&&s[i]=='r'&&f[i-7])f[i]=1;
	}
	puts(f[n]?"YES":"NO");
/*	for(scanf("%d",&T);T--;){
		
	}*/
}