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

#include <cstring>

#include <algorithm>



typedef long long ll;



char s[100005]; int n;

bool dp[100005];



int main() {

	scanf("%s", s + 1); n = strlen(s + 1);

	

	dp[0] = 1;

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

		if (i >= 5 && s[i - 4] == 'd' && s[i - 3] == 'r' && s[i - 2] == 'e' && s[i - 1] == 'a' && s[i] == 'm') dp[i] |= dp[i - 5];

		if (i >= 7 && 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') dp[i] |= dp[i - 7];

		if (i >= 5 && s[i - 4] == 'e' && s[i - 3] == 'r' && s[i - 2] == 'a' && s[i - 1] == 's' && s[i] == 'e') dp[i] |= dp[i - 5];

		if (i >= 6 && s[i - 5] == 'e' && s[i - 4] == 'r' && s[i - 3] == 'a' && s[i - 2] == 's' && s[i - 1] == 'e' && s[i] == 'r') dp[i] |= dp[i - 6];

	}

	

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

	

	return 0;

}