    import java.lang.*;
    import java.io.*;
    import java.util.*;
     
     
    public class Main {
    	
    	public static void main(String[] args) throws java.lang.Exception {
    		InputStream inputStream = System.in;
    		OutputStream outputStream = System.out;
    		InputReader in = new InputReader(inputStream);
    		PrintWriter out = new PrintWriter(outputStream);
    		TaskA solver = new TaskA();
    		solver.solve(in, out);
    		out.close();
    	}
    }
     
    class TaskA {
    	
    	public void solve(InputReader in, PrintWriter out) {
    		final String dream = "dream";
    		final String dreamer = "dreamer";
    		final String erase = "erase";
    		final String eraser = "eraser";
    		final int dreamLen = dream.length();
    		final int dreamerLen = dreamer.length();
    		final int eraseLen = erase.length();
    		final int eraserLen = eraser.length();
    		
    		final String s = in.next();
    		final int slen = s.length();
    		int i = 0, j;
    		char ch;
    		
    		while (i < slen) {
    			ch = s.charAt(i);
    			if (ch!='d' && ch!='e') {
    				out.println("NO");
    				return;
    			}
    			
    			boolean flag = false;
    			
    			if (ch == 'e') {
    				if (i+eraserLen <= slen) {
    					if (eraser.equals(s.substring(i, i+eraserLen))) {
    						flag = true;
    						i += eraserLen;
    					}
    				}
    				if (!flag && i+eraseLen <= slen) {
    					if (erase.equals(s.substring(i, i+eraseLen))) {
    						flag = true;
    						i += eraseLen;
    					}
    				}
    			} else {
    				if (i+dreamerLen<=slen && dreamer.equals(s.substring(i, i+dreamerLen))) {
    					flag = true;
    					if (i+dreamLen+eraseLen<=slen && erase.equals(s.substring(i+dreamLen, i+dreamLen+eraseLen))) {
    						i += dreamLen;
    					} else {
    						i += dreamerLen;
    					}
    				} else if (i+dreamLen<=slen && dream.equals(s.substring(i, i+dreamLen))) {
    					flag = true;
    					i += dreamLen;
    				}
    			}
    			
    			if (!flag) {
    				out.println("NO");
    				return ;
    			}
    		}
    		
    		if (i == slen)
    			out.println("YES");
    		else
    			out.println("NO");
    	}
    }
     
    class InputReader {
    	public BufferedReader reader;
    	public StringTokenizer tokenizer;
    	
    	public InputReader(InputStream stream) {
    		reader = new BufferedReader(new InputStreamReader(stream), 32768);
    		tokenizer = null;
    	}
    	
    	public String next() {
    		while (tokenizer==null || !tokenizer.hasMoreTokens()) {
    			try {
    				tokenizer = new StringTokenizer(reader.readLine());
    			} catch (IOException e) {
    				throw new RuntimeException(e);
    			}
    		}
    		return tokenizer.nextToken();
    	}
    	
    	public int nextInt() {
    		return Integer.parseInt(next());
    	}
    	
    	public double nextDouble() {
    		return Double.parseDouble(next());
    	}
    	
    	public long nextLong() {
    		return Long.parseLong(next());
    	}
    } import java.lang.*; lang.* java import java.io.*; io.* java import java.util.*; util.* java public class Main {
    	
    	public static void main(String[] args) throws java.lang.Exception {
    		InputStream inputStream = System.in;
    		OutputStream outputStream = System.out;
    		InputReader in = new InputReader(inputStream);
    		PrintWriter out = new PrintWriter(outputStream);
    		TaskA solver = new TaskA();
    		solver.solve(in, out);
    		out.close();
    	}
    } Main public static void main(String[] args) throws java.lang.Exception {
    		InputStream inputStream = System.in;
    		OutputStream outputStream = System.out;
    		InputReader in = new InputReader(inputStream);
    		PrintWriter out = new PrintWriter(outputStream);
    		TaskA solver = new TaskA();
    		solver.solve(in, out);
    		out.close();
    	} main {
    		InputStream inputStream = System.in;
    		OutputStream outputStream = System.out;
    		InputReader in = new InputReader(inputStream);
    		PrintWriter out = new PrintWriter(outputStream);
    		TaskA solver = new TaskA();
    		solver.solve(in, out);
    		out.close();
    	} InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out InputReader in = new InputReader(inputStream); in new InputReader(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) TaskA solver = new TaskA(); solver new TaskA() solver.solve(in, out) solver.solve solver in out out.close() out.close out String[] args args class TaskA {
    	
    	public void solve(InputReader in, PrintWriter out) {
    		final String dream = "dream";
    		final String dreamer = "dreamer";
    		final String erase = "erase";
    		final String eraser = "eraser";
    		final int dreamLen = dream.length();
    		final int dreamerLen = dreamer.length();
    		final int eraseLen = erase.length();
    		final int eraserLen = eraser.length();
    		
    		final String s = in.next();
    		final int slen = s.length();
    		int i = 0, j;
    		char ch;
    		
    		while (i < slen) {
    			ch = s.charAt(i);
    			if (ch!='d' && ch!='e') {
    				out.println("NO");
    				return;
    			}
    			
    			boolean flag = false;
    			
    			if (ch == 'e') {
    				if (i+eraserLen <= slen) {
    					if (eraser.equals(s.substring(i, i+eraserLen))) {
    						flag = true;
    						i += eraserLen;
    					}
    				}
    				if (!flag && i+eraseLen <= slen) {
    					if (erase.equals(s.substring(i, i+eraseLen))) {
    						flag = true;
    						i += eraseLen;
    					}
    				}
    			} else {
    				if (i+dreamerLen<=slen && dreamer.equals(s.substring(i, i+dreamerLen))) {
    					flag = true;
    					if (i+dreamLen+eraseLen<=slen && erase.equals(s.substring(i+dreamLen, i+dreamLen+eraseLen))) {
    						i += dreamLen;
    					} else {
    						i += dreamerLen;
    					}
    				} else if (i+dreamLen<=slen && dream.equals(s.substring(i, i+dreamLen))) {
    					flag = true;
    					i += dreamLen;
    				}
    			}
    			
    			if (!flag) {
    				out.println("NO");
    				return ;
    			}
    		}
    		
    		if (i == slen)
    			out.println("YES");
    		else
    			out.println("NO");
    	}
    } TaskA public void solve(InputReader in, PrintWriter out) {
    		final String dream = "dream";
    		final String dreamer = "dreamer";
    		final String erase = "erase";
    		final String eraser = "eraser";
    		final int dreamLen = dream.length();
    		final int dreamerLen = dreamer.length();
    		final int eraseLen = erase.length();
    		final int eraserLen = eraser.length();
    		
    		final String s = in.next();
    		final int slen = s.length();
    		int i = 0, j;
    		char ch;
    		
    		while (i < slen) {
    			ch = s.charAt(i);
    			if (ch!='d' && ch!='e') {
    				out.println("NO");
    				return;
    			}
    			
    			boolean flag = false;
    			
    			if (ch == 'e') {
    				if (i+eraserLen <= slen) {
    					if (eraser.equals(s.substring(i, i+eraserLen))) {
    						flag = true;
    						i += eraserLen;
    					}
    				}
    				if (!flag && i+eraseLen <= slen) {
    					if (erase.equals(s.substring(i, i+eraseLen))) {
    						flag = true;
    						i += eraseLen;
    					}
    				}
    			} else {
    				if (i+dreamerLen<=slen && dreamer.equals(s.substring(i, i+dreamerLen))) {
    					flag = true;
    					if (i+dreamLen+eraseLen<=slen && erase.equals(s.substring(i+dreamLen, i+dreamLen+eraseLen))) {
    						i += dreamLen;
    					} else {
    						i += dreamerLen;
    					}
    				} else if (i+dreamLen<=slen && dream.equals(s.substring(i, i+dreamLen))) {
    					flag = true;
    					i += dreamLen;
    				}
    			}
    			
    			if (!flag) {
    				out.println("NO");
    				return ;
    			}
    		}
    		
    		if (i == slen)
    			out.println("YES");
    		else
    			out.println("NO");
    	} solve {
    		final String dream = "dream";
    		final String dreamer = "dreamer";
    		final String erase = "erase";
    		final String eraser = "eraser";
    		final int dreamLen = dream.length();
    		final int dreamerLen = dreamer.length();
    		final int eraseLen = erase.length();
    		final int eraserLen = eraser.length();
    		
    		final String s = in.next();
    		final int slen = s.length();
    		int i = 0, j;
    		char ch;
    		
    		while (i < slen) {
    			ch = s.charAt(i);
    			if (ch!='d' && ch!='e') {
    				out.println("NO");
    				return;
    			}
    			
    			boolean flag = false;
    			
    			if (ch == 'e') {
    				if (i+eraserLen <= slen) {
    					if (eraser.equals(s.substring(i, i+eraserLen))) {
    						flag = true;
    						i += eraserLen;
    					}
    				}
    				if (!flag && i+eraseLen <= slen) {
    					if (erase.equals(s.substring(i, i+eraseLen))) {
    						flag = true;
    						i += eraseLen;
    					}
    				}
    			} else {
    				if (i+dreamerLen<=slen && dreamer.equals(s.substring(i, i+dreamerLen))) {
    					flag = true;
    					if (i+dreamLen+eraseLen<=slen && erase.equals(s.substring(i+dreamLen, i+dreamLen+eraseLen))) {
    						i += dreamLen;
    					} else {
    						i += dreamerLen;
    					}
    				} else if (i+dreamLen<=slen && dream.equals(s.substring(i, i+dreamLen))) {
    					flag = true;
    					i += dreamLen;
    				}
    			}
    			
    			if (!flag) {
    				out.println("NO");
    				return ;
    			}
    		}
    		
    		if (i == slen)
    			out.println("YES");
    		else
    			out.println("NO");
    	} final String dream = "dream"; dream "dream" final String dreamer = "dreamer"; dreamer "dreamer" final String erase = "erase"; erase "erase" final String eraser = "eraser"; eraser "eraser" final int dreamLen = dream.length(); dreamLen dream.length() dream.length dream final int dreamerLen = dreamer.length(); dreamerLen dreamer.length() dreamer.length dreamer final int eraseLen = erase.length(); eraseLen erase.length() erase.length erase final int eraserLen = eraser.length(); eraserLen eraser.length() eraser.length eraser final String s = in.next(); s in.next() in.next in final int slen = s.length(); slen s.length() s.length s int i = 0 i 0 j; j char ch; ch while (i < slen) {
    			ch = s.charAt(i);
    			if (ch!='d' && ch!='e') {
    				out.println("NO");
    				return;
    			}
    			
    			boolean flag = false;
    			
    			if (ch == 'e') {
    				if (i+eraserLen <= slen) {
    					if (eraser.equals(s.substring(i, i+eraserLen))) {
    						flag = true;
    						i += eraserLen;
    					}
    				}
    				if (!flag && i+eraseLen <= slen) {
    					if (erase.equals(s.substring(i, i+eraseLen))) {
    						flag = true;
    						i += eraseLen;
    					}
    				}
    			} else {
    				if (i+dreamerLen<=slen && dreamer.equals(s.substring(i, i+dreamerLen))) {
    					flag = true;
    					if (i+dreamLen+eraseLen<=slen && erase.equals(s.substring(i+dreamLen, i+dreamLen+eraseLen))) {
    						i += dreamLen;
    					} else {
    						i += dreamerLen;
    					}
    				} else if (i+dreamLen<=slen && dream.equals(s.substring(i, i+dreamLen))) {
    					flag = true;
    					i += dreamLen;
    				}
    			}
    			
    			if (!flag) {
    				out.println("NO");
    				return ;
    			}
    		} i < slen i slen {
    			ch = s.charAt(i);
    			if (ch!='d' && ch!='e') {
    				out.println("NO");
    				return;
    			}
    			
    			boolean flag = false;
    			
    			if (ch == 'e') {
    				if (i+eraserLen <= slen) {
    					if (eraser.equals(s.substring(i, i+eraserLen))) {
    						flag = true;
    						i += eraserLen;
    					}
    				}
    				if (!flag && i+eraseLen <= slen) {
    					if (erase.equals(s.substring(i, i+eraseLen))) {
    						flag = true;
    						i += eraseLen;
    					}
    				}
    			} else {
    				if (i+dreamerLen<=slen && dreamer.equals(s.substring(i, i+dreamerLen))) {
    					flag = true;
    					if (i+dreamLen+eraseLen<=slen && erase.equals(s.substring(i+dreamLen, i+dreamLen+eraseLen))) {
    						i += dreamLen;
    					} else {
    						i += dreamerLen;
    					}
    				} else if (i+dreamLen<=slen && dream.equals(s.substring(i, i+dreamLen))) {
    					flag = true;
    					i += dreamLen;
    				}
    			}
    			
    			if (!flag) {
    				out.println("NO");
    				return ;
    			}
    		} ch = s.charAt(i) ch s.charAt(i) s.charAt s i if (ch!='d' && ch!='e') {
    				out.println("NO");
    				return;
    			} ch!='d' && ch!='e' ch!='d' ch 'd' ch!='e' ch 'e' {
    				out.println("NO");
    				return;
    			} out.println("NO") out.println out "NO" return; boolean flag = false; flag false if (ch == 'e') {
    				if (i+eraserLen <= slen) {
    					if (eraser.equals(s.substring(i, i+eraserLen))) {
    						flag = true;
    						i += eraserLen;
    					}
    				}
    				if (!flag && i+eraseLen <= slen) {
    					if (erase.equals(s.substring(i, i+eraseLen))) {
    						flag = true;
    						i += eraseLen;
    					}
    				}
    			} else {
    				if (i+dreamerLen<=slen && dreamer.equals(s.substring(i, i+dreamerLen))) {
    					flag = true;
    					if (i+dreamLen+eraseLen<=slen && erase.equals(s.substring(i+dreamLen, i+dreamLen+eraseLen))) {
    						i += dreamLen;
    					} else {
    						i += dreamerLen;
    					}
    				} else if (i+dreamLen<=slen && dream.equals(s.substring(i, i+dreamLen))) {
    					flag = true;
    					i += dreamLen;
    				}
    			} ch == 'e' ch 'e' {
    				if (i+eraserLen <= slen) {
    					if (eraser.equals(s.substring(i, i+eraserLen))) {
    						flag = true;
    						i += eraserLen;
    					}
    				}
    				if (!flag && i+eraseLen <= slen) {
    					if (erase.equals(s.substring(i, i+eraseLen))) {
    						flag = true;
    						i += eraseLen;
    					}
    				}
    			} if (i+eraserLen <= slen) {
    					if (eraser.equals(s.substring(i, i+eraserLen))) {
    						flag = true;
    						i += eraserLen;
    					}
    				} i+eraserLen <= slen i+eraserLen i eraserLen slen {
    					if (eraser.equals(s.substring(i, i+eraserLen))) {
    						flag = true;
    						i += eraserLen;
    					}
    				} if (eraser.equals(s.substring(i, i+eraserLen))) {
    						flag = true;
    						i += eraserLen;
    					} eraser.equals(s.substring(i, i+eraserLen)) eraser.equals eraser s.substring(i, i+eraserLen) s.substring s i i+eraserLen i eraserLen {
    						flag = true;
    						i += eraserLen;
    					} flag = true flag true i += eraserLen i eraserLen if (!flag && i+eraseLen <= slen) {
    					if (erase.equals(s.substring(i, i+eraseLen))) {
    						flag = true;
    						i += eraseLen;
    					}
    				} !flag && i+eraseLen <= slen !flag flag i+eraseLen <= slen i+eraseLen i eraseLen slen {
    					if (erase.equals(s.substring(i, i+eraseLen))) {
    						flag = true;
    						i += eraseLen;
    					}
    				} if (erase.equals(s.substring(i, i+eraseLen))) {
    						flag = true;
    						i += eraseLen;
    					} erase.equals(s.substring(i, i+eraseLen)) erase.equals erase s.substring(i, i+eraseLen) s.substring s i i+eraseLen i eraseLen {
    						flag = true;
    						i += eraseLen;
    					} flag = true flag true i += eraseLen i eraseLen {
    				if (i+dreamerLen<=slen && dreamer.equals(s.substring(i, i+dreamerLen))) {
    					flag = true;
    					if (i+dreamLen+eraseLen<=slen && erase.equals(s.substring(i+dreamLen, i+dreamLen+eraseLen))) {
    						i += dreamLen;
    					} else {
    						i += dreamerLen;
    					}
    				} else if (i+dreamLen<=slen && dream.equals(s.substring(i, i+dreamLen))) {
    					flag = true;
    					i += dreamLen;
    				}
    			} if (i+dreamerLen<=slen && dreamer.equals(s.substring(i, i+dreamerLen))) {
    					flag = true;
    					if (i+dreamLen+eraseLen<=slen && erase.equals(s.substring(i+dreamLen, i+dreamLen+eraseLen))) {
    						i += dreamLen;
    					} else {
    						i += dreamerLen;
    					}
    				} else if (i+dreamLen<=slen && dream.equals(s.substring(i, i+dreamLen))) {
    					flag = true;
    					i += dreamLen;
    				} i+dreamerLen<=slen && dreamer.equals(s.substring(i, i+dreamerLen)) i+dreamerLen<=slen i+dreamerLen i dreamerLen slen dreamer.equals(s.substring(i, i+dreamerLen)) dreamer.equals dreamer s.substring(i, i+dreamerLen) s.substring s i i+dreamerLen i dreamerLen {
    					flag = true;
    					if (i+dreamLen+eraseLen<=slen && erase.equals(s.substring(i+dreamLen, i+dreamLen+eraseLen))) {
    						i += dreamLen;
    					} else {
    						i += dreamerLen;
    					}
    				} flag = true flag true if (i+dreamLen+eraseLen<=slen && erase.equals(s.substring(i+dreamLen, i+dreamLen+eraseLen))) {
    						i += dreamLen;
    					} else {
    						i += dreamerLen;
    					} i+dreamLen+eraseLen<=slen && erase.equals(s.substring(i+dreamLen, i+dreamLen+eraseLen)) i+dreamLen+eraseLen<=slen i+dreamLen+eraseLen i+dreamLen+eraseLen i dreamLen eraseLen slen erase.equals(s.substring(i+dreamLen, i+dreamLen+eraseLen)) erase.equals erase s.substring(i+dreamLen, i+dreamLen+eraseLen) s.substring s i+dreamLen i dreamLen i+dreamLen+eraseLen i+dreamLen+eraseLen i dreamLen eraseLen {
    						i += dreamLen;
    					} i += dreamLen i dreamLen {
    						i += dreamerLen;
    					} i += dreamerLen i dreamerLen if (i+dreamLen<=slen && dream.equals(s.substring(i, i+dreamLen))) {
    					flag = true;
    					i += dreamLen;
    				} i+dreamLen<=slen && dream.equals(s.substring(i, i+dreamLen)) i+dreamLen<=slen i+dreamLen i dreamLen slen dream.equals(s.substring(i, i+dreamLen)) dream.equals dream s.substring(i, i+dreamLen) s.substring s i i+dreamLen i dreamLen {
    					flag = true;
    					i += dreamLen;
    				} flag = true flag true i += dreamLen i dreamLen if (!flag) {
    				out.println("NO");
    				return ;
    			} !flag flag {
    				out.println("NO");
    				return ;
    			} out.println("NO") out.println out "NO" return ; if (i == slen)
    			out.println("YES");
    		else
    			out.println("NO"); i == slen i slen out.println("YES") out.println out "YES" out.println("NO") out.println out "NO" InputReader in in PrintWriter out out class InputReader {
    	public BufferedReader reader;
    	public StringTokenizer tokenizer;
    	
    	public InputReader(InputStream stream) {
    		reader = new BufferedReader(new InputStreamReader(stream), 32768);
    		tokenizer = null;
    	}
    	
    	public String next() {
    		while (tokenizer==null || !tokenizer.hasMoreTokens()) {
    			try {
    				tokenizer = new StringTokenizer(reader.readLine());
    			} catch (IOException e) {
    				throw new RuntimeException(e);
    			}
    		}
    		return tokenizer.nextToken();
    	}
    	
    	public int nextInt() {
    		return Integer.parseInt(next());
    	}
    	
    	public double nextDouble() {
    		return Double.parseDouble(next());
    	}
    	
    	public long nextLong() {
    		return Long.parseLong(next());
    	}
    } InputReader public BufferedReader reader; reader public StringTokenizer tokenizer; tokenizer public InputReader(InputStream stream) {
    		reader = new BufferedReader(new InputStreamReader(stream), 32768);
    		tokenizer = null;
    	} InputReader {
    		reader = new BufferedReader(new InputStreamReader(stream), 32768);
    		tokenizer = null;
    	} reader = new BufferedReader(new InputStreamReader(stream), 32768) reader new BufferedReader(new InputStreamReader(stream), 32768) tokenizer = null tokenizer null InputStream stream stream public String next() {
    		while (tokenizer==null || !tokenizer.hasMoreTokens()) {
    			try {
    				tokenizer = new StringTokenizer(reader.readLine());
    			} catch (IOException e) {
    				throw new RuntimeException(e);
    			}
    		}
    		return tokenizer.nextToken();
    	} next {
    		while (tokenizer==null || !tokenizer.hasMoreTokens()) {
    			try {
    				tokenizer = new StringTokenizer(reader.readLine());
    			} catch (IOException e) {
    				throw new RuntimeException(e);
    			}
    		}
    		return tokenizer.nextToken();
    	} while (tokenizer==null || !tokenizer.hasMoreTokens()) {
    			try {
    				tokenizer = new StringTokenizer(reader.readLine());
    			} catch (IOException e) {
    				throw new RuntimeException(e);
    			}
    		} tokenizer==null || !tokenizer.hasMoreTokens() tokenizer==null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
    			try {
    				tokenizer = new StringTokenizer(reader.readLine());
    			} catch (IOException e) {
    				throw new RuntimeException(e);
    			}
    		} try {
    				tokenizer = new StringTokenizer(reader.readLine());
    			} catch (IOException e) {
    				throw new RuntimeException(e);
    			} catch (IOException e) {
    				throw new RuntimeException(e);
    			} IOException e {
    				throw new RuntimeException(e);
    			} throw new RuntimeException(e); new RuntimeException(e) {
    				tokenizer = new StringTokenizer(reader.readLine());
    			} tokenizer = new StringTokenizer(reader.readLine()) tokenizer new StringTokenizer(reader.readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer public int nextInt() {
    		return Integer.parseInt(next());
    	} nextInt {
    		return Integer.parseInt(next());
    	} return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public double nextDouble() {
    		return Double.parseDouble(next());
    	} nextDouble {
    		return Double.parseDouble(next());
    	} return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public long nextLong() {
    		return Long.parseLong(next());
    	} nextLong {
    		return Long.parseLong(next());
    	} return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public class Main {
    	
    	public static void main(String[] args) throws java.lang.Exception {
    		InputStream inputStream = System.in;
    		OutputStream outputStream = System.out;
    		InputReader in = new InputReader(inputStream);
    		PrintWriter out = new PrintWriter(outputStream);
    		TaskA solver = new TaskA();
    		solver.solve(in, out);
    		out.close();
    	}
    } public class Main {
    	
    	public static void main(String[] args) throws java.lang.Exception {
    		InputStream inputStream = System.in;
    		OutputStream outputStream = System.out;
    		InputReader in = new InputReader(inputStream);
    		PrintWriter out = new PrintWriter(outputStream);
    		TaskA solver = new TaskA();
    		solver.solve(in, out);
    		out.close();
    	}
    } Main
    import java.lang.*;
    import java.io.*;
    import java.util.*;
     
     
    public class Main {
    	
    	public static void main(String[] args) throws java.lang.Exception {
    		InputStream inputStream = System.in;
    		OutputStream outputStream = System.out;
    		InputReader in = new InputReader(inputStream);
    		PrintWriter out = new PrintWriter(outputStream);
    		TaskA solver = new TaskA();
    		solver.solve(in, out);
    		out.close();
    	}
    }
     
    class TaskA {
    	
    	public void solve(InputReader in, PrintWriter out) {
    		final String dream = "dream";
    		final String dreamer = "dreamer";
    		final String erase = "erase";
    		final String eraser = "eraser";
    		final int dreamLen = dream.length();
    		final int dreamerLen = dreamer.length();
    		final int eraseLen = erase.length();
    		final int eraserLen = eraser.length();
    		
    		final String s = in.next();
    		final int slen = s.length();
    		int i = 0, j;
    		char ch;
    		
    		while (i < slen) {
    			ch = s.charAt(i);
    			if (ch!='d' && ch!='e') {
    				out.println("NO");
    				return;
    			}
    			
    			boolean flag = false;
    			
    			if (ch == 'e') {
    				if (i+eraserLen <= slen) {
    					if (eraser.equals(s.substring(i, i+eraserLen))) {
    						flag = true;
    						i += eraserLen;
    					}
    				}
    				if (!flag && i+eraseLen <= slen) {
    					if (erase.equals(s.substring(i, i+eraseLen))) {
    						flag = true;
    						i += eraseLen;
    					}
    				}
    			} else {
    				if (i+dreamerLen<=slen && dreamer.equals(s.substring(i, i+dreamerLen))) {
    					flag = true;
    					if (i+dreamLen+eraseLen<=slen && erase.equals(s.substring(i+dreamLen, i+dreamLen+eraseLen))) {
    						i += dreamLen;
    					} else {
    						i += dreamerLen;
    					}
    				} else if (i+dreamLen<=slen && dream.equals(s.substring(i, i+dreamLen))) {
    					flag = true;
    					i += dreamLen;
    				}
    			}
    			
    			if (!flag) {
    				out.println("NO");
    				return ;
    			}
    		}
    		
    		if (i == slen)
    			out.println("YES");
    		else
    			out.println("NO");
    	}
    }
     
    class InputReader {
    	public BufferedReader reader;
    	public StringTokenizer tokenizer;
    	
    	public InputReader(InputStream stream) {
    		reader = new BufferedReader(new InputStreamReader(stream), 32768);
    		tokenizer = null;
    	}
    	
    	public String next() {
    		while (tokenizer==null || !tokenizer.hasMoreTokens()) {
    			try {
    				tokenizer = new StringTokenizer(reader.readLine());
    			} catch (IOException e) {
    				throw new RuntimeException(e);
    			}
    		}
    		return tokenizer.nextToken();
    	}
    	
    	public int nextInt() {
    		return Integer.parseInt(next());
    	}
    	
    	public double nextDouble() {
    		return Double.parseDouble(next());
    	}
    	
    	public long nextLong() {
    		return Long.parseLong(next());
    	}
    }