import java.lang.*;
import java.util.*;
public class Main{
public static void main(String[] args) 
{
	Scanner scanner=new Scanner(System.in);
	String s=scanner.next();
	int tr=0;
	int ans=1;
	int i=0;
	while(true)
	{	tr=0;
		if(i>=s.length())break;
		String s1=" ",s2=" ",s3=" ",s4=" ";
		if(i+5<=s.length())s1=s.substring(i,i+5);
		if(i+6<=s.length())s2=s.substring(i,i+6);
		if(i+7<=s.length())s3=s.substring(i,i+7);
		if(s1.compareTo("dream")==0)tr=1;
		if(s1.compareTo("erase")==0)tr=2;
		if(s2.compareTo("eraser")==0)tr=4;
		if(s3.compareTo("dreamer")==0){
			if(i+10<=s.length())s4=s.substring(i,i+10);
			if(s4.compareTo("dreamerase")==0)tr=1;
			else tr=3;
		}
		if(tr==0){ans=0;break;}
		if(tr==3){i+=7;continue;}
		if(tr==4){i+=6;continue;}
		if(tr==1 || tr==2)i+=5;
	}
	if(ans==1)System.out.println("YES");
	else System.out.println("NO");
}	
} import java.lang.*; lang.* java import java.util.*; util.* java public class Main{
public static void main(String[] args) 
{
	Scanner scanner=new Scanner(System.in);
	String s=scanner.next();
	int tr=0;
	int ans=1;
	int i=0;
	while(true)
	{	tr=0;
		if(i>=s.length())break;
		String s1=" ",s2=" ",s3=" ",s4=" ";
		if(i+5<=s.length())s1=s.substring(i,i+5);
		if(i+6<=s.length())s2=s.substring(i,i+6);
		if(i+7<=s.length())s3=s.substring(i,i+7);
		if(s1.compareTo("dream")==0)tr=1;
		if(s1.compareTo("erase")==0)tr=2;
		if(s2.compareTo("eraser")==0)tr=4;
		if(s3.compareTo("dreamer")==0){
			if(i+10<=s.length())s4=s.substring(i,i+10);
			if(s4.compareTo("dreamerase")==0)tr=1;
			else tr=3;
		}
		if(tr==0){ans=0;break;}
		if(tr==3){i+=7;continue;}
		if(tr==4){i+=6;continue;}
		if(tr==1 || tr==2)i+=5;
	}
	if(ans==1)System.out.println("YES");
	else System.out.println("NO");
}	
} Main public static void main(String[] args) 
{
	Scanner scanner=new Scanner(System.in);
	String s=scanner.next();
	int tr=0;
	int ans=1;
	int i=0;
	while(true)
	{	tr=0;
		if(i>=s.length())break;
		String s1=" ",s2=" ",s3=" ",s4=" ";
		if(i+5<=s.length())s1=s.substring(i,i+5);
		if(i+6<=s.length())s2=s.substring(i,i+6);
		if(i+7<=s.length())s3=s.substring(i,i+7);
		if(s1.compareTo("dream")==0)tr=1;
		if(s1.compareTo("erase")==0)tr=2;
		if(s2.compareTo("eraser")==0)tr=4;
		if(s3.compareTo("dreamer")==0){
			if(i+10<=s.length())s4=s.substring(i,i+10);
			if(s4.compareTo("dreamerase")==0)tr=1;
			else tr=3;
		}
		if(tr==0){ans=0;break;}
		if(tr==3){i+=7;continue;}
		if(tr==4){i+=6;continue;}
		if(tr==1 || tr==2)i+=5;
	}
	if(ans==1)System.out.println("YES");
	else System.out.println("NO");
} main {
	Scanner scanner=new Scanner(System.in);
	String s=scanner.next();
	int tr=0;
	int ans=1;
	int i=0;
	while(true)
	{	tr=0;
		if(i>=s.length())break;
		String s1=" ",s2=" ",s3=" ",s4=" ";
		if(i+5<=s.length())s1=s.substring(i,i+5);
		if(i+6<=s.length())s2=s.substring(i,i+6);
		if(i+7<=s.length())s3=s.substring(i,i+7);
		if(s1.compareTo("dream")==0)tr=1;
		if(s1.compareTo("erase")==0)tr=2;
		if(s2.compareTo("eraser")==0)tr=4;
		if(s3.compareTo("dreamer")==0){
			if(i+10<=s.length())s4=s.substring(i,i+10);
			if(s4.compareTo("dreamerase")==0)tr=1;
			else tr=3;
		}
		if(tr==0){ans=0;break;}
		if(tr==3){i+=7;continue;}
		if(tr==4){i+=6;continue;}
		if(tr==1 || tr==2)i+=5;
	}
	if(ans==1)System.out.println("YES");
	else System.out.println("NO");
} Scanner scanner=new Scanner(System.in); scanner new Scanner(System.in) String s=scanner.next(); s scanner.next() scanner.next scanner int tr=0; tr 0 int ans=1; ans 1 int i=0; i 0 while(true)
	{	tr=0;
		if(i>=s.length())break;
		String s1=" ",s2=" ",s3=" ",s4=" ";
		if(i+5<=s.length())s1=s.substring(i,i+5);
		if(i+6<=s.length())s2=s.substring(i,i+6);
		if(i+7<=s.length())s3=s.substring(i,i+7);
		if(s1.compareTo("dream")==0)tr=1;
		if(s1.compareTo("erase")==0)tr=2;
		if(s2.compareTo("eraser")==0)tr=4;
		if(s3.compareTo("dreamer")==0){
			if(i+10<=s.length())s4=s.substring(i,i+10);
			if(s4.compareTo("dreamerase")==0)tr=1;
			else tr=3;
		}
		if(tr==0){ans=0;break;}
		if(tr==3){i+=7;continue;}
		if(tr==4){i+=6;continue;}
		if(tr==1 || tr==2)i+=5;
	} true {	tr=0;
		if(i>=s.length())break;
		String s1=" ",s2=" ",s3=" ",s4=" ";
		if(i+5<=s.length())s1=s.substring(i,i+5);
		if(i+6<=s.length())s2=s.substring(i,i+6);
		if(i+7<=s.length())s3=s.substring(i,i+7);
		if(s1.compareTo("dream")==0)tr=1;
		if(s1.compareTo("erase")==0)tr=2;
		if(s2.compareTo("eraser")==0)tr=4;
		if(s3.compareTo("dreamer")==0){
			if(i+10<=s.length())s4=s.substring(i,i+10);
			if(s4.compareTo("dreamerase")==0)tr=1;
			else tr=3;
		}
		if(tr==0){ans=0;break;}
		if(tr==3){i+=7;continue;}
		if(tr==4){i+=6;continue;}
		if(tr==1 || tr==2)i+=5;
	} tr=0 tr 0 if(i>=s.length())break; i>=s.length() i s.length() s.length s break; String s1=" " s1 " " s2=" " s2 " " s3=" " s3 " " s4=" "; s4 " " if(i+5<=s.length())s1=s.substring(i,i+5); i+5<=s.length() i+5 i 5 s.length() s.length s s1=s.substring(i,i+5) s1 s.substring(i,i+5) s.substring s i i+5 i 5 if(i+6<=s.length())s2=s.substring(i,i+6); i+6<=s.length() i+6 i 6 s.length() s.length s s2=s.substring(i,i+6) s2 s.substring(i,i+6) s.substring s i i+6 i 6 if(i+7<=s.length())s3=s.substring(i,i+7); i+7<=s.length() i+7 i 7 s.length() s.length s s3=s.substring(i,i+7) s3 s.substring(i,i+7) s.substring s i i+7 i 7 if(s1.compareTo("dream")==0)tr=1; s1.compareTo("dream")==0 s1.compareTo("dream") s1.compareTo s1 "dream" 0 tr=1 tr 1 if(s1.compareTo("erase")==0)tr=2; s1.compareTo("erase")==0 s1.compareTo("erase") s1.compareTo s1 "erase" 0 tr=2 tr 2 if(s2.compareTo("eraser")==0)tr=4; s2.compareTo("eraser")==0 s2.compareTo("eraser") s2.compareTo s2 "eraser" 0 tr=4 tr 4 if(s3.compareTo("dreamer")==0){
			if(i+10<=s.length())s4=s.substring(i,i+10);
			if(s4.compareTo("dreamerase")==0)tr=1;
			else tr=3;
		} s3.compareTo("dreamer")==0 s3.compareTo("dreamer") s3.compareTo s3 "dreamer" 0 {
			if(i+10<=s.length())s4=s.substring(i,i+10);
			if(s4.compareTo("dreamerase")==0)tr=1;
			else tr=3;
		} if(i+10<=s.length())s4=s.substring(i,i+10); i+10<=s.length() i+10 i 10 s.length() s.length s s4=s.substring(i,i+10) s4 s.substring(i,i+10) s.substring s i i+10 i 10 if(s4.compareTo("dreamerase")==0)tr=1;
			else tr=3; s4.compareTo("dreamerase")==0 s4.compareTo("dreamerase") s4.compareTo s4 "dreamerase" 0 tr=1 tr 1 tr=3 tr 3 if(tr==0){ans=0;break;} tr==0 tr 0 {ans=0;break;} ans=0 ans 0 break; if(tr==3){i+=7;continue;} tr==3 tr 3 {i+=7;continue;} i+=7 i 7 continue; if(tr==4){i+=6;continue;} tr==4 tr 4 {i+=6;continue;} i+=6 i 6 continue; if(tr==1 || tr==2)i+=5; tr==1 || tr==2 tr==1 tr 1 tr==2 tr 2 i+=5 i 5 if(ans==1)System.out.println("YES");
	else System.out.println("NO"); ans==1 ans 1 System.out.println("YES") System.out.println System.out System System.out "YES" System.out.println("NO") System.out.println System.out System System.out "NO" String[] args args public class Main{
public static void main(String[] args) 
{
	Scanner scanner=new Scanner(System.in);
	String s=scanner.next();
	int tr=0;
	int ans=1;
	int i=0;
	while(true)
	{	tr=0;
		if(i>=s.length())break;
		String s1=" ",s2=" ",s3=" ",s4=" ";
		if(i+5<=s.length())s1=s.substring(i,i+5);
		if(i+6<=s.length())s2=s.substring(i,i+6);
		if(i+7<=s.length())s3=s.substring(i,i+7);
		if(s1.compareTo("dream")==0)tr=1;
		if(s1.compareTo("erase")==0)tr=2;
		if(s2.compareTo("eraser")==0)tr=4;
		if(s3.compareTo("dreamer")==0){
			if(i+10<=s.length())s4=s.substring(i,i+10);
			if(s4.compareTo("dreamerase")==0)tr=1;
			else tr=3;
		}
		if(tr==0){ans=0;break;}
		if(tr==3){i+=7;continue;}
		if(tr==4){i+=6;continue;}
		if(tr==1 || tr==2)i+=5;
	}
	if(ans==1)System.out.println("YES");
	else System.out.println("NO");
}	
} public class Main{
public static void main(String[] args) 
{
	Scanner scanner=new Scanner(System.in);
	String s=scanner.next();
	int tr=0;
	int ans=1;
	int i=0;
	while(true)
	{	tr=0;
		if(i>=s.length())break;
		String s1=" ",s2=" ",s3=" ",s4=" ";
		if(i+5<=s.length())s1=s.substring(i,i+5);
		if(i+6<=s.length())s2=s.substring(i,i+6);
		if(i+7<=s.length())s3=s.substring(i,i+7);
		if(s1.compareTo("dream")==0)tr=1;
		if(s1.compareTo("erase")==0)tr=2;
		if(s2.compareTo("eraser")==0)tr=4;
		if(s3.compareTo("dreamer")==0){
			if(i+10<=s.length())s4=s.substring(i,i+10);
			if(s4.compareTo("dreamerase")==0)tr=1;
			else tr=3;
		}
		if(tr==0){ans=0;break;}
		if(tr==3){i+=7;continue;}
		if(tr==4){i+=6;continue;}
		if(tr==1 || tr==2)i+=5;
	}
	if(ans==1)System.out.println("YES");
	else System.out.println("NO");
}	
} Main
import java.lang.*;
import java.util.*;
public class Main{
public static void main(String[] args) 
{
	Scanner scanner=new Scanner(System.in);
	String s=scanner.next();
	int tr=0;
	int ans=1;
	int i=0;
	while(true)
	{	tr=0;
		if(i>=s.length())break;
		String s1=" ",s2=" ",s3=" ",s4=" ";
		if(i+5<=s.length())s1=s.substring(i,i+5);
		if(i+6<=s.length())s2=s.substring(i,i+6);
		if(i+7<=s.length())s3=s.substring(i,i+7);
		if(s1.compareTo("dream")==0)tr=1;
		if(s1.compareTo("erase")==0)tr=2;
		if(s2.compareTo("eraser")==0)tr=4;
		if(s3.compareTo("dreamer")==0){
			if(i+10<=s.length())s4=s.substring(i,i+10);
			if(s4.compareTo("dreamerase")==0)tr=1;
			else tr=3;
		}
		if(tr==0){ans=0;break;}
		if(tr==3){i+=7;continue;}
		if(tr==4){i+=6;continue;}
		if(tr==1 || tr==2)i+=5;
	}
	if(ans==1)System.out.println("YES");
	else System.out.println("NO");
}	
}
