






import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Queue;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.Set;



public class Main{
	
	static int posx;
	static int posy;
	static int type;
	static int diff;
	static int INF = Integer.MAX_VALUE;
	static int[][] d;
	
	//最大公約数・最小公倍数（セットで使う）
	public static long gcm(long a, long b) {
		long result = a;
		long k = 0;
		long n = b;
		do {
			k = result % n;
			result = n;
			n = k;
		} while(k != 0);
		return result;
	}
	
	public static long lcm(long a, long b) {
		long g;
		g = gcm(a, b);
		return a/g*b;
	}
	
	static long gcd (long a, long b) {
		long temp;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return b;
	}
	
	//等差数列
	static long tousasum(int n) {
		return (long)n*((long)n+1)/2;
	}



	//素数判定
	static boolean isPrime (int n) {
		if (n==2) return true;
		if (n<2 || n%2==0) return false;
		double d = Math.sqrt(n);
		for (int i=3; i<=d; i+=2) if(n%i==0){return false;}
		return true;
	}


	//倍数判定（10進数以外のときに有用）
	static boolean isMultiple (String s, int base, int m) {
		int temp = 0;
		for (int i=0; i<s.length(); i++) {
			temp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;
		}
		if (temp==0) {return true;}
		return false;
	}


	//階乗
	static long factorial (int i) {
		if (i==1) {return 1;}
		else {return i*factorial(i-1);}
	}


	//進数変換
	static String toNbase (String sm, int m, int n) {
		return Long.toString(Long.parseLong(sm,m),n);
	}
	
	public static final long gcd_n(long[] param) {
	    final int len = param.length;
	    long g = gcd(param[0], param[1]);    //gcd(a, b) は以前作ったもの
	    for (int i = 1; i < len - 1; i++) {
	        g = gcd(g, param[i + 1]);       //gcd(a, b) は以前作ったもの
	    }
	    return g;
	}
	
	public static long lcm_n(long[] numbers) {
		long l;
		l = numbers[0];
		for (int i = 1; i < numbers.length; i++) {
			l = lcm(l, numbers[i]);
		}
		return l;
	}
	
	
 public static void main(String[] args) {
	 Scanner sc=new Scanner(System.in);
	 String s=sc.next();
	 
	 /*
	 while(s.contains("dreameraser")) {
	    
	    s=s.replace("dreameraser", "");
	 }*/
	 
	 
	 
	 while(s.contains("eraser")) {
		 s=s.replace("eraser","");
	 }
	 
	 while(s.contains("erase")) {
		 s=s.replace("erase","");
	 }
	 
	 while(s.contains("dreamer")) {
		 s=s.replace("dreamer", "");
	 }
	 
	 
	 
	
	 
	 while(s.contains("dream")) {
		 s=s.replace("dream", "");
	 }
	 
	 if(s.length()==0) {
		 System.out.println("YES");
	 }else {
		 System.out.println("NO");
	 }
	 
   
	 
	 
 }
	


} import java.util.ArrayDeque; ArrayDeque java.util import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.Comparator; Comparator java.util import java.util.Queue; Queue java.util import java.util.HashMap; HashMap java.util import java.util.HashSet; HashSet java.util import java.util.Iterator; Iterator java.util import java.util.List; List java.util import java.util.Map; Map java.util import java.util.Map.Entry; Entry java.util.Map import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main{
	
	static int posx;
	static int posy;
	static int type;
	static int diff;
	static int INF = Integer.MAX_VALUE;
	static int[][] d;
	
	//最大公約数・最小公倍数（セットで使う）
	public static long gcm(long a, long b) {
		long result = a;
		long k = 0;
		long n = b;
		do {
			k = result % n;
			result = n;
			n = k;
		} while(k != 0);
		return result;
	}
	
	public static long lcm(long a, long b) {
		long g;
		g = gcm(a, b);
		return a/g*b;
	}
	
	static long gcd (long a, long b) {
		long temp;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return b;
	}
	
	//等差数列
	static long tousasum(int n) {
		return (long)n*((long)n+1)/2;
	}



	//素数判定
	static boolean isPrime (int n) {
		if (n==2) return true;
		if (n<2 || n%2==0) return false;
		double d = Math.sqrt(n);
		for (int i=3; i<=d; i+=2) if(n%i==0){return false;}
		return true;
	}


	//倍数判定（10進数以外のときに有用）
	static boolean isMultiple (String s, int base, int m) {
		int temp = 0;
		for (int i=0; i<s.length(); i++) {
			temp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;
		}
		if (temp==0) {return true;}
		return false;
	}


	//階乗
	static long factorial (int i) {
		if (i==1) {return 1;}
		else {return i*factorial(i-1);}
	}


	//進数変換
	static String toNbase (String sm, int m, int n) {
		return Long.toString(Long.parseLong(sm,m),n);
	}
	
	public static final long gcd_n(long[] param) {
	    final int len = param.length;
	    long g = gcd(param[0], param[1]);    //gcd(a, b) は以前作ったもの
	    for (int i = 1; i < len - 1; i++) {
	        g = gcd(g, param[i + 1]);       //gcd(a, b) は以前作ったもの
	    }
	    return g;
	}
	
	public static long lcm_n(long[] numbers) {
		long l;
		l = numbers[0];
		for (int i = 1; i < numbers.length; i++) {
			l = lcm(l, numbers[i]);
		}
		return l;
	}
	
	
 public static void main(String[] args) {
	 Scanner sc=new Scanner(System.in);
	 String s=sc.next();
	 
	 /*
	 while(s.contains("dreameraser")) {
	    
	    s=s.replace("dreameraser", "");
	 }*/
	 
	 
	 
	 while(s.contains("eraser")) {
		 s=s.replace("eraser","");
	 }
	 
	 while(s.contains("erase")) {
		 s=s.replace("erase","");
	 }
	 
	 while(s.contains("dreamer")) {
		 s=s.replace("dreamer", "");
	 }
	 
	 
	 
	
	 
	 while(s.contains("dream")) {
		 s=s.replace("dream", "");
	 }
	 
	 if(s.length()==0) {
		 System.out.println("YES");
	 }else {
		 System.out.println("NO");
	 }
	 
   
	 
	 
 }
	


} Main static int posx; posx static int posy; posy static int type; type static int diff; diff static int INF = Integer.MAX_VALUE; INF Integer.MAX_VALUE Integer Integer.MAX_VALUE static int[][] d; d //最大公約数・最小公倍数（セットで使う）
	public static long gcm(long a, long b) {
		long result = a;
		long k = 0;
		long n = b;
		do {
			k = result % n;
			result = n;
			n = k;
		} while(k != 0);
		return result;
	} gcm {
		long result = a;
		long k = 0;
		long n = b;
		do {
			k = result % n;
			result = n;
			n = k;
		} while(k != 0);
		return result;
	} long result = a; result a long k = 0; k 0 long n = b; n b do {
			k = result % n;
			result = n;
			n = k;
		} while(k != 0); k != 0 k 0 {
			k = result % n;
			result = n;
			n = k;
		} k = result % n k result % n result n result = n result n n = k n k return result; result long a a long b b public static long lcm(long a, long b) {
		long g;
		g = gcm(a, b);
		return a/g*b;
	} lcm {
		long g;
		g = gcm(a, b);
		return a/g*b;
	} long g; g g = gcm(a, b) g gcm(a, b) gcm a b return a/g*b; a/g*b a/g a g b long a a long b b static long gcd (long a, long b) {
		long temp;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return b;
	} gcd {
		long temp;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return b;
	} long temp; temp while((temp = a%b)!=0) {
			a = b;
			b = temp;
		} (temp = a%b)!=0 (temp = a%b) temp a%b a b 0 {
			a = b;
			b = temp;
		} a = b a b b = temp b temp return b; b long a a long b b //等差数列
	static long tousasum(int n) {
		return (long)n*((long)n+1)/2;
	} tousasum {
		return (long)n*((long)n+1)/2;
	} return (long)n*((long)n+1)/2; (long)n*((long)n+1)/2 (long)n*((long)n+1) (long)n ((long)n+1) (long)n 1 2 int n n //素数判定
	static boolean isPrime (int n) {
		if (n==2) return true;
		if (n<2 || n%2==0) return false;
		double d = Math.sqrt(n);
		for (int i=3; i<=d; i+=2) if(n%i==0){return false;}
		return true;
	} isPrime {
		if (n==2) return true;
		if (n<2 || n%2==0) return false;
		double d = Math.sqrt(n);
		for (int i=3; i<=d; i+=2) if(n%i==0){return false;}
		return true;
	} if (n==2) return true; n==2 n 2 return true; true if (n<2 || n%2==0) return false; n<2 || n%2==0 n<2 n 2 n%2==0 n%2 n 2 0 return false; false double d = Math.sqrt(n); d Math.sqrt(n) Math.sqrt Math n for (int i=3; i<=d; i+=2) if(n%i==0){return false;} int i=3; int i=3; i 3 i<=d i d i+=2 i+=2 i 2 if(n%i==0){return false;} if(n%i==0){return false;} n%i==0 n%i n i 0 {return false;} return false; false return true; true int n n //倍数判定（10進数以外のときに有用）
	static boolean isMultiple (String s, int base, int m) {
		int temp = 0;
		for (int i=0; i<s.length(); i++) {
			temp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;
		}
		if (temp==0) {return true;}
		return false;
	} isMultiple {
		int temp = 0;
		for (int i=0; i<s.length(); i++) {
			temp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;
		}
		if (temp==0) {return true;}
		return false;
	} int temp = 0; temp 0 for (int i=0; i<s.length(); i++) {
			temp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;
		} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			temp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;
		} {
			temp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;
		} temp = (temp*base+Character.getNumericValue(s.charAt(i)))%m temp (temp*base+Character.getNumericValue(s.charAt(i)))%m (temp*base+Character.getNumericValue(s.charAt(i))) temp*base temp base Character.getNumericValue(s.charAt(i)) Character.getNumericValue Character s.charAt(i) s.charAt s i m if (temp==0) {return true;} temp==0 temp 0 {return true;} return true; true return false; false String s s int base base int m m //階乗
	static long factorial (int i) {
		if (i==1) {return 1;}
		else {return i*factorial(i-1);}
	} factorial {
		if (i==1) {return 1;}
		else {return i*factorial(i-1);}
	} if (i==1) {return 1;}
		else {return i*factorial(i-1);} i==1 i 1 {return 1;} return 1; 1 {return i*factorial(i-1);} return i*factorial(i-1); i*factorial(i-1) i factorial(i-1) factorial i-1 i 1 int i i //進数変換
	static String toNbase (String sm, int m, int n) {
		return Long.toString(Long.parseLong(sm,m),n);
	} toNbase {
		return Long.toString(Long.parseLong(sm,m),n);
	} return Long.toString(Long.parseLong(sm,m),n); Long.toString(Long.parseLong(sm,m),n) Long.toString Long Long.parseLong(sm,m) Long.parseLong Long sm m n String sm sm int m m int n n public static final long gcd_n(long[] param) {
	    final int len = param.length;
	    long g = gcd(param[0], param[1]);    //gcd(a, b) は以前作ったもの
	    for (int i = 1; i < len - 1; i++) {
	        g = gcd(g, param[i + 1]);       //gcd(a, b) は以前作ったもの
	    }
	    return g;
	} gcd_n {
	    final int len = param.length;
	    long g = gcd(param[0], param[1]);    //gcd(a, b) は以前作ったもの
	    for (int i = 1; i < len - 1; i++) {
	        g = gcd(g, param[i + 1]);       //gcd(a, b) は以前作ったもの
	    }
	    return g;
	} final int len = param.length; len param.length param param.length long g = gcd(param[0], param[1]); g gcd(param[0], param[1]) gcd param[0] param 0 param[1] param 1 for (int i = 1; i < len - 1; i++) {
	        g = gcd(g, param[i + 1]);       //gcd(a, b) は以前作ったもの
	    } int i = 1; int i = 1; i 1 i < len - 1 i len - 1 len 1 i++ i++ i {
	        g = gcd(g, param[i + 1]);       //gcd(a, b) は以前作ったもの
	    } {
	        g = gcd(g, param[i + 1]);       //gcd(a, b) は以前作ったもの
	    } g = gcd(g, param[i + 1]) g gcd(g, param[i + 1]) gcd g param[i + 1] param i + 1 i 1 return g; g long[] param param public static long lcm_n(long[] numbers) {
		long l;
		l = numbers[0];
		for (int i = 1; i < numbers.length; i++) {
			l = lcm(l, numbers[i]);
		}
		return l;
	} lcm_n {
		long l;
		l = numbers[0];
		for (int i = 1; i < numbers.length; i++) {
			l = lcm(l, numbers[i]);
		}
		return l;
	} long l; l l = numbers[0] l numbers[0] numbers 0 for (int i = 1; i < numbers.length; i++) {
			l = lcm(l, numbers[i]);
		} int i = 1; int i = 1; i 1 i < numbers.length i numbers.length numbers numbers.length i++ i++ i {
			l = lcm(l, numbers[i]);
		} {
			l = lcm(l, numbers[i]);
		} l = lcm(l, numbers[i]) l lcm(l, numbers[i]) lcm l numbers[i] numbers i return l; l long[] numbers numbers public static void main(String[] args) {
	 Scanner sc=new Scanner(System.in);
	 String s=sc.next();
	 
	 /*
	 while(s.contains("dreameraser")) {
	    
	    s=s.replace("dreameraser", "");
	 }*/
	 
	 
	 
	 while(s.contains("eraser")) {
		 s=s.replace("eraser","");
	 }
	 
	 while(s.contains("erase")) {
		 s=s.replace("erase","");
	 }
	 
	 while(s.contains("dreamer")) {
		 s=s.replace("dreamer", "");
	 }
	 
	 
	 
	
	 
	 while(s.contains("dream")) {
		 s=s.replace("dream", "");
	 }
	 
	 if(s.length()==0) {
		 System.out.println("YES");
	 }else {
		 System.out.println("NO");
	 }
	 
   
	 
	 
 } main {
	 Scanner sc=new Scanner(System.in);
	 String s=sc.next();
	 
	 /*
	 while(s.contains("dreameraser")) {
	    
	    s=s.replace("dreameraser", "");
	 }*/
	 
	 
	 
	 while(s.contains("eraser")) {
		 s=s.replace("eraser","");
	 }
	 
	 while(s.contains("erase")) {
		 s=s.replace("erase","");
	 }
	 
	 while(s.contains("dreamer")) {
		 s=s.replace("dreamer", "");
	 }
	 
	 
	 
	
	 
	 while(s.contains("dream")) {
		 s=s.replace("dream", "");
	 }
	 
	 if(s.length()==0) {
		 System.out.println("YES");
	 }else {
		 System.out.println("NO");
	 }
	 
   
	 
	 
 } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) String s=sc.next(); s sc.next() sc.next sc while(s.contains("eraser")) {
		 s=s.replace("eraser","");
	 } s.contains("eraser") s.contains s "eraser" {
		 s=s.replace("eraser","");
	 } s=s.replace("eraser","") s s.replace("eraser","") s.replace s "eraser" "" while(s.contains("erase")) {
		 s=s.replace("erase","");
	 } s.contains("erase") s.contains s "erase" {
		 s=s.replace("erase","");
	 } s=s.replace("erase","") s s.replace("erase","") s.replace s "erase" "" while(s.contains("dreamer")) {
		 s=s.replace("dreamer", "");
	 } s.contains("dreamer") s.contains s "dreamer" {
		 s=s.replace("dreamer", "");
	 } s=s.replace("dreamer", "") s s.replace("dreamer", "") s.replace s "dreamer" "" while(s.contains("dream")) {
		 s=s.replace("dream", "");
	 } s.contains("dream") s.contains s "dream" {
		 s=s.replace("dream", "");
	 } s=s.replace("dream", "") s s.replace("dream", "") s.replace s "dream" "" if(s.length()==0) {
		 System.out.println("YES");
	 }else {
		 System.out.println("NO");
	 } s.length()==0 s.length() s.length s 0 {
		 System.out.println("YES");
	 } System.out.println("YES") System.out.println System.out System System.out "YES" {
		 System.out.println("NO");
	 } System.out.println("NO") System.out.println System.out System System.out "NO" String[] args args public class Main{
	
	static int posx;
	static int posy;
	static int type;
	static int diff;
	static int INF = Integer.MAX_VALUE;
	static int[][] d;
	
	//最大公約数・最小公倍数（セットで使う）
	public static long gcm(long a, long b) {
		long result = a;
		long k = 0;
		long n = b;
		do {
			k = result % n;
			result = n;
			n = k;
		} while(k != 0);
		return result;
	}
	
	public static long lcm(long a, long b) {
		long g;
		g = gcm(a, b);
		return a/g*b;
	}
	
	static long gcd (long a, long b) {
		long temp;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return b;
	}
	
	//等差数列
	static long tousasum(int n) {
		return (long)n*((long)n+1)/2;
	}



	//素数判定
	static boolean isPrime (int n) {
		if (n==2) return true;
		if (n<2 || n%2==0) return false;
		double d = Math.sqrt(n);
		for (int i=3; i<=d; i+=2) if(n%i==0){return false;}
		return true;
	}


	//倍数判定（10進数以外のときに有用）
	static boolean isMultiple (String s, int base, int m) {
		int temp = 0;
		for (int i=0; i<s.length(); i++) {
			temp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;
		}
		if (temp==0) {return true;}
		return false;
	}


	//階乗
	static long factorial (int i) {
		if (i==1) {return 1;}
		else {return i*factorial(i-1);}
	}


	//進数変換
	static String toNbase (String sm, int m, int n) {
		return Long.toString(Long.parseLong(sm,m),n);
	}
	
	public static final long gcd_n(long[] param) {
	    final int len = param.length;
	    long g = gcd(param[0], param[1]);    //gcd(a, b) は以前作ったもの
	    for (int i = 1; i < len - 1; i++) {
	        g = gcd(g, param[i + 1]);       //gcd(a, b) は以前作ったもの
	    }
	    return g;
	}
	
	public static long lcm_n(long[] numbers) {
		long l;
		l = numbers[0];
		for (int i = 1; i < numbers.length; i++) {
			l = lcm(l, numbers[i]);
		}
		return l;
	}
	
	
 public static void main(String[] args) {
	 Scanner sc=new Scanner(System.in);
	 String s=sc.next();
	 
	 /*
	 while(s.contains("dreameraser")) {
	    
	    s=s.replace("dreameraser", "");
	 }*/
	 
	 
	 
	 while(s.contains("eraser")) {
		 s=s.replace("eraser","");
	 }
	 
	 while(s.contains("erase")) {
		 s=s.replace("erase","");
	 }
	 
	 while(s.contains("dreamer")) {
		 s=s.replace("dreamer", "");
	 }
	 
	 
	 
	
	 
	 while(s.contains("dream")) {
		 s=s.replace("dream", "");
	 }
	 
	 if(s.length()==0) {
		 System.out.println("YES");
	 }else {
		 System.out.println("NO");
	 }
	 
   
	 
	 
 }
	


} public class Main{
	
	static int posx;
	static int posy;
	static int type;
	static int diff;
	static int INF = Integer.MAX_VALUE;
	static int[][] d;
	
	//最大公約数・最小公倍数（セットで使う）
	public static long gcm(long a, long b) {
		long result = a;
		long k = 0;
		long n = b;
		do {
			k = result % n;
			result = n;
			n = k;
		} while(k != 0);
		return result;
	}
	
	public static long lcm(long a, long b) {
		long g;
		g = gcm(a, b);
		return a/g*b;
	}
	
	static long gcd (long a, long b) {
		long temp;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return b;
	}
	
	//等差数列
	static long tousasum(int n) {
		return (long)n*((long)n+1)/2;
	}



	//素数判定
	static boolean isPrime (int n) {
		if (n==2) return true;
		if (n<2 || n%2==0) return false;
		double d = Math.sqrt(n);
		for (int i=3; i<=d; i+=2) if(n%i==0){return false;}
		return true;
	}


	//倍数判定（10進数以外のときに有用）
	static boolean isMultiple (String s, int base, int m) {
		int temp = 0;
		for (int i=0; i<s.length(); i++) {
			temp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;
		}
		if (temp==0) {return true;}
		return false;
	}


	//階乗
	static long factorial (int i) {
		if (i==1) {return 1;}
		else {return i*factorial(i-1);}
	}


	//進数変換
	static String toNbase (String sm, int m, int n) {
		return Long.toString(Long.parseLong(sm,m),n);
	}
	
	public static final long gcd_n(long[] param) {
	    final int len = param.length;
	    long g = gcd(param[0], param[1]);    //gcd(a, b) は以前作ったもの
	    for (int i = 1; i < len - 1; i++) {
	        g = gcd(g, param[i + 1]);       //gcd(a, b) は以前作ったもの
	    }
	    return g;
	}
	
	public static long lcm_n(long[] numbers) {
		long l;
		l = numbers[0];
		for (int i = 1; i < numbers.length; i++) {
			l = lcm(l, numbers[i]);
		}
		return l;
	}
	
	
 public static void main(String[] args) {
	 Scanner sc=new Scanner(System.in);
	 String s=sc.next();
	 
	 /*
	 while(s.contains("dreameraser")) {
	    
	    s=s.replace("dreameraser", "");
	 }*/
	 
	 
	 
	 while(s.contains("eraser")) {
		 s=s.replace("eraser","");
	 }
	 
	 while(s.contains("erase")) {
		 s=s.replace("erase","");
	 }
	 
	 while(s.contains("dreamer")) {
		 s=s.replace("dreamer", "");
	 }
	 
	 
	 
	
	 
	 while(s.contains("dream")) {
		 s=s.replace("dream", "");
	 }
	 
	 if(s.length()==0) {
		 System.out.println("YES");
	 }else {
		 System.out.println("NO");
	 }
	 
   
	 
	 
 }
	


} Main







import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Queue;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.Set;



public class Main{
	
	static int posx;
	static int posy;
	static int type;
	static int diff;
	static int INF = Integer.MAX_VALUE;
	static int[][] d;
	
	//最大公約数・最小公倍数（セットで使う）
	public static long gcm(long a, long b) {
		long result = a;
		long k = 0;
		long n = b;
		do {
			k = result % n;
			result = n;
			n = k;
		} while(k != 0);
		return result;
	}
	
	public static long lcm(long a, long b) {
		long g;
		g = gcm(a, b);
		return a/g*b;
	}
	
	static long gcd (long a, long b) {
		long temp;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return b;
	}
	
	//等差数列
	static long tousasum(int n) {
		return (long)n*((long)n+1)/2;
	}



	//素数判定
	static boolean isPrime (int n) {
		if (n==2) return true;
		if (n<2 || n%2==0) return false;
		double d = Math.sqrt(n);
		for (int i=3; i<=d; i+=2) if(n%i==0){return false;}
		return true;
	}


	//倍数判定（10進数以外のときに有用）
	static boolean isMultiple (String s, int base, int m) {
		int temp = 0;
		for (int i=0; i<s.length(); i++) {
			temp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;
		}
		if (temp==0) {return true;}
		return false;
	}


	//階乗
	static long factorial (int i) {
		if (i==1) {return 1;}
		else {return i*factorial(i-1);}
	}


	//進数変換
	static String toNbase (String sm, int m, int n) {
		return Long.toString(Long.parseLong(sm,m),n);
	}
	
	public static final long gcd_n(long[] param) {
	    final int len = param.length;
	    long g = gcd(param[0], param[1]);    //gcd(a, b) は以前作ったもの
	    for (int i = 1; i < len - 1; i++) {
	        g = gcd(g, param[i + 1]);       //gcd(a, b) は以前作ったもの
	    }
	    return g;
	}
	
	public static long lcm_n(long[] numbers) {
		long l;
		l = numbers[0];
		for (int i = 1; i < numbers.length; i++) {
			l = lcm(l, numbers[i]);
		}
		return l;
	}
	
	
 public static void main(String[] args) {
	 Scanner sc=new Scanner(System.in);
	 String s=sc.next();
	 
	 /*
	 while(s.contains("dreameraser")) {
	    
	    s=s.replace("dreameraser", "");
	 }*/
	 
	 
	 
	 while(s.contains("eraser")) {
		 s=s.replace("eraser","");
	 }
	 
	 while(s.contains("erase")) {
		 s=s.replace("erase","");
	 }
	 
	 while(s.contains("dreamer")) {
		 s=s.replace("dreamer", "");
	 }
	 
	 
	 
	
	 
	 while(s.contains("dream")) {
		 s=s.replace("dream", "");
	 }
	 
	 if(s.length()==0) {
		 System.out.println("YES");
	 }else {
		 System.out.println("NO");
	 }
	 
   
	 
	 
 }
	


}
