import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		
		// 計算
		String result = "YES";
		boolean flg = true;
		int to = s.length();
		while(flg){
		    if(to-5 >= 0){
		        String t = s.substring(to-5, to);
		        if(t.equals("dream") || t.equals("erase")){
		            to -= 5;
		            continue;
		        }
		    }
		    if(to-6 >= 0){
		        String t = s.substring(to-6, to);
		        if(t.equals("eraser")){
		            to -= 6;
		            continue;
		        }
		    }
		    if(to-7 >= 0){
		        String t = s.substring(to-7, to);
		        if(t.equals("dreamer")){
		            to -= 7;
		            continue;
		        }
		    }
		    flg = false;
		    if(to != 0) result = "NO";
		}
		
		// 出力
		System.out.println(result);
	}

	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}
} import java.util.*; util.* java import java.io.*; io.* java import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		
		// 計算
		String result = "YES";
		boolean flg = true;
		int to = s.length();
		while(flg){
		    if(to-5 >= 0){
		        String t = s.substring(to-5, to);
		        if(t.equals("dream") || t.equals("erase")){
		            to -= 5;
		            continue;
		        }
		    }
		    if(to-6 >= 0){
		        String t = s.substring(to-6, to);
		        if(t.equals("eraser")){
		            to -= 6;
		            continue;
		        }
		    }
		    if(to-7 >= 0){
		        String t = s.substring(to-7, to);
		        if(t.equals("dreamer")){
		            to -= 7;
		            continue;
		        }
		    }
		    flg = false;
		    if(to != 0) result = "NO";
		}
		
		// 出力
		System.out.println(result);
	}

	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		
		// 計算
		String result = "YES";
		boolean flg = true;
		int to = s.length();
		while(flg){
		    if(to-5 >= 0){
		        String t = s.substring(to-5, to);
		        if(t.equals("dream") || t.equals("erase")){
		            to -= 5;
		            continue;
		        }
		    }
		    if(to-6 >= 0){
		        String t = s.substring(to-6, to);
		        if(t.equals("eraser")){
		            to -= 6;
		            continue;
		        }
		    }
		    if(to-7 >= 0){
		        String t = s.substring(to-7, to);
		        if(t.equals("dreamer")){
		            to -= 7;
		            continue;
		        }
		    }
		    flg = false;
		    if(to != 0) result = "NO";
		}
		
		// 出力
		System.out.println(result);
	} main {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		
		// 計算
		String result = "YES";
		boolean flg = true;
		int to = s.length();
		while(flg){
		    if(to-5 >= 0){
		        String t = s.substring(to-5, to);
		        if(t.equals("dream") || t.equals("erase")){
		            to -= 5;
		            continue;
		        }
		    }
		    if(to-6 >= 0){
		        String t = s.substring(to-6, to);
		        if(t.equals("eraser")){
		            to -= 6;
		            continue;
		        }
		    }
		    if(to-7 >= 0){
		        String t = s.substring(to-7, to);
		        if(t.equals("dreamer")){
		            to -= 7;
		            continue;
		        }
		    }
		    flg = false;
		    if(to != 0) result = "NO";
		}
		
		// 出力
		System.out.println(result);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String result = "YES"; result "YES" boolean flg = true; flg true int to = s.length(); to s.length() s.length s while(flg){
		    if(to-5 >= 0){
		        String t = s.substring(to-5, to);
		        if(t.equals("dream") || t.equals("erase")){
		            to -= 5;
		            continue;
		        }
		    }
		    if(to-6 >= 0){
		        String t = s.substring(to-6, to);
		        if(t.equals("eraser")){
		            to -= 6;
		            continue;
		        }
		    }
		    if(to-7 >= 0){
		        String t = s.substring(to-7, to);
		        if(t.equals("dreamer")){
		            to -= 7;
		            continue;
		        }
		    }
		    flg = false;
		    if(to != 0) result = "NO";
		} flg {
		    if(to-5 >= 0){
		        String t = s.substring(to-5, to);
		        if(t.equals("dream") || t.equals("erase")){
		            to -= 5;
		            continue;
		        }
		    }
		    if(to-6 >= 0){
		        String t = s.substring(to-6, to);
		        if(t.equals("eraser")){
		            to -= 6;
		            continue;
		        }
		    }
		    if(to-7 >= 0){
		        String t = s.substring(to-7, to);
		        if(t.equals("dreamer")){
		            to -= 7;
		            continue;
		        }
		    }
		    flg = false;
		    if(to != 0) result = "NO";
		} if(to-5 >= 0){
		        String t = s.substring(to-5, to);
		        if(t.equals("dream") || t.equals("erase")){
		            to -= 5;
		            continue;
		        }
		    } to-5 >= 0 to-5 to 5 0 {
		        String t = s.substring(to-5, to);
		        if(t.equals("dream") || t.equals("erase")){
		            to -= 5;
		            continue;
		        }
		    } String t = s.substring(to-5, to); t s.substring(to-5, to) s.substring s to-5 to 5 to if(t.equals("dream") || t.equals("erase")){
		            to -= 5;
		            continue;
		        } t.equals("dream") || t.equals("erase") t.equals("dream") t.equals t "dream" t.equals("erase") t.equals t "erase" {
		            to -= 5;
		            continue;
		        } to -= 5 to 5 continue; if(to-6 >= 0){
		        String t = s.substring(to-6, to);
		        if(t.equals("eraser")){
		            to -= 6;
		            continue;
		        }
		    } to-6 >= 0 to-6 to 6 0 {
		        String t = s.substring(to-6, to);
		        if(t.equals("eraser")){
		            to -= 6;
		            continue;
		        }
		    } String t = s.substring(to-6, to); t s.substring(to-6, to) s.substring s to-6 to 6 to if(t.equals("eraser")){
		            to -= 6;
		            continue;
		        } t.equals("eraser") t.equals t "eraser" {
		            to -= 6;
		            continue;
		        } to -= 6 to 6 continue; if(to-7 >= 0){
		        String t = s.substring(to-7, to);
		        if(t.equals("dreamer")){
		            to -= 7;
		            continue;
		        }
		    } to-7 >= 0 to-7 to 7 0 {
		        String t = s.substring(to-7, to);
		        if(t.equals("dreamer")){
		            to -= 7;
		            continue;
		        }
		    } String t = s.substring(to-7, to); t s.substring(to-7, to) s.substring s to-7 to 7 to if(t.equals("dreamer")){
		            to -= 7;
		            continue;
		        } t.equals("dreamer") t.equals t "dreamer" {
		            to -= 7;
		            continue;
		        } to -= 7 to 7 continue; flg = false flg false if(to != 0) result = "NO"; to != 0 to 0 result = "NO" result "NO" System.out.println(result) System.out.println System.out System System.out result String[] args args public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	} Scanner private BufferedReader br; br private StringTokenizer tok; tok public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));} Scanner { br = new BufferedReader(new InputStreamReader(is));} br = new BufferedReader(new InputStreamReader(is)) br new BufferedReader(new InputStreamReader(is)) InputStream is is private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());} getLine { while(!hasNext()) tok = new StringTokenizer(br.readLine());} while(!hasNext()) tok = new StringTokenizer(br.readLine()); !hasNext() hasNext() hasNext tok = new StringTokenizer(br.readLine()) tok new StringTokenizer(br.readLine()) private boolean hasNext() { return tok != null && tok.hasMoreTokens();} hasNext { return tok != null && tok.hasMoreTokens();} return tok != null && tok.hasMoreTokens(); tok != null && tok.hasMoreTokens() tok != null tok null tok.hasMoreTokens() tok.hasMoreTokens tok public String next() throws IOException { getLine(); return tok.nextToken();} next { getLine(); return tok.nextToken();} getLine() getLine return tok.nextToken(); tok.nextToken() tok.nextToken tok public int nextInt() throws IOException { return Integer.parseInt(next());} nextInt { return Integer.parseInt(next());} return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public long nextLong() throws IOException { return Long.parseLong(next());} nextLong { return Long.parseLong(next());} return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public double nextDouble() throws IOException { return Double.parseDouble(next());} nextDouble { return Double.parseDouble(next());} return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		
		// 計算
		String result = "YES";
		boolean flg = true;
		int to = s.length();
		while(flg){
		    if(to-5 >= 0){
		        String t = s.substring(to-5, to);
		        if(t.equals("dream") || t.equals("erase")){
		            to -= 5;
		            continue;
		        }
		    }
		    if(to-6 >= 0){
		        String t = s.substring(to-6, to);
		        if(t.equals("eraser")){
		            to -= 6;
		            continue;
		        }
		    }
		    if(to-7 >= 0){
		        String t = s.substring(to-7, to);
		        if(t.equals("dreamer")){
		            to -= 7;
		            continue;
		        }
		    }
		    flg = false;
		    if(to != 0) result = "NO";
		}
		
		// 出力
		System.out.println(result);
	}

	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}
} public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		
		// 計算
		String result = "YES";
		boolean flg = true;
		int to = s.length();
		while(flg){
		    if(to-5 >= 0){
		        String t = s.substring(to-5, to);
		        if(t.equals("dream") || t.equals("erase")){
		            to -= 5;
		            continue;
		        }
		    }
		    if(to-6 >= 0){
		        String t = s.substring(to-6, to);
		        if(t.equals("eraser")){
		            to -= 6;
		            continue;
		        }
		    }
		    if(to-7 >= 0){
		        String t = s.substring(to-7, to);
		        if(t.equals("dreamer")){
		            to -= 7;
		            continue;
		        }
		    }
		    flg = false;
		    if(to != 0) result = "NO";
		}
		
		// 出力
		System.out.println(result);
	}

	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}
} Main
import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		
		// 計算
		String result = "YES";
		boolean flg = true;
		int to = s.length();
		while(flg){
		    if(to-5 >= 0){
		        String t = s.substring(to-5, to);
		        if(t.equals("dream") || t.equals("erase")){
		            to -= 5;
		            continue;
		        }
		    }
		    if(to-6 >= 0){
		        String t = s.substring(to-6, to);
		        if(t.equals("eraser")){
		            to -= 6;
		            continue;
		        }
		    }
		    if(to-7 >= 0){
		        String t = s.substring(to-7, to);
		        if(t.equals("dreamer")){
		            to -= 7;
		            continue;
		        }
		    }
		    flg = false;
		    if(to != 0) result = "NO";
		}
		
		// 出力
		System.out.println(result);
	}

	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}
}
