#include<bits/stdc++.h>

using namespace std;

char s[100010];
int n;

int check(int opt,int x)
{
	if(x==0)
	{
		if(s[opt-4]=='e'&&s[opt-3]=='r'&&s[opt-2]=='a'&&s[opt-1]=='s'&&s[opt]=='e')return 1;
		if(s[opt-4]=='d'&&s[opt-3]=='r'&&s[opt-2]=='e'&&s[opt-1]=='a'&&s[opt]=='m')return 1;
		return 0;
	}
	else
	{
		if((x==1)&&(s[opt-5]=='e'&&s[opt-4]=='r'&&s[opt-3]=='a'&&s[opt-2]=='s'&&s[opt-1]=='e'&&s[opt]=='r'))return 1;
		if((x==2)&&(s[opt-6]=='d'&&s[opt-5]=='r'&&s[opt-4]=='e'&&s[opt-3]=='a'&&s[opt-2]=='m'&&s[opt-1]=='e'&&s[opt]=='r'))return 1;
		return 0;
	}
}

int main()
{
	scanf("%s",s+1);
	n=strlen(s+1);
	for(int now=n;now;)
	{
		if(now<5)
		{
			puts("NO");
			return 0;
		}
		if(check(now,0))
		{
			now-=5;
			continue;
		}
		if(check(now,1))
		{
			now-=6;
			continue;
		}
		if(check(now,2))
		{
			now-=7;
			continue;
		}
		puts("NO");
		return 0;
	}
	puts("YES");
}