import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
	
	String dream = "dream";
	String dreamer = "dreamer";
	String erase = "erase";
	String eraser = "eraser";

	public static void main(String[] args) throws IOException {
		Main mainObj = new Main();
		mainObj.solve();
	}

	public void solve() throws IOException {
		FastScanner fs = new FastScanner();
		
		String s = fs.next();
		
		int index = 0;
		boolean yes = true;
		
		while(index < s.length()) {
			int retIndex;
			if(s.charAt(index) == 'e') {
				retIndex = checkEraseOrEraser(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else if(s.charAt(index) == 'd') {
				retIndex = checkDreamOrDreamer(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else {
				yes = false;
				break;
			}
				
			
		}
		
		if(yes) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}
	
	
	int checkDreamOrDreamer(String s, int index) {
		
		int beforeIndex = 0;
		for(; beforeIndex < dream.length() && beforeIndex + index < s.length(); beforeIndex++) {
			if(s.charAt(index + beforeIndex) != dream.charAt(beforeIndex)) {
				return -1;
			}
		}
		
		if(beforeIndex < dream.length()) {
			return -1;
		}
		
		int afterIndex = 0;
		for(; afterIndex < 3 && index + dream.length() + afterIndex < s.length(); afterIndex++) {
			if(s.charAt(index + dream.length() + afterIndex) != eraser.charAt(afterIndex)) {
				break;
			}
		}
		
		if(afterIndex == 2) {
			return index + dream.length()+2;
		}else {
			return index +dream.length() ;
		}
	}
	
	int checkEraseOrEraser(String s, int index) {
		int beforeIndex = 0;
		for(; beforeIndex < erase.length() && beforeIndex + index < s.length(); beforeIndex++) {
			if(s.charAt(index + beforeIndex) != erase.charAt(beforeIndex)) {
				return -1;
			}
		}
		
		if(beforeIndex < erase.length()) {
			return -1;
		}
		
		int afterIndex = 0;
		for(; afterIndex < 2 && index + erase.length() + afterIndex < s.length(); afterIndex++) {
			if(s.charAt(index + erase.length() + afterIndex) != eraser.charAt(afterIndex+1)) {
				break;
			}
		}
		
		if(afterIndex == 1) {
			return index + erase.length()+1;
		}else {
			return index +erase.length() ;
		}
	}

	

	public class FastScanner {

		BufferedReader reader;
		private StringTokenizer st;

		public FastScanner() {
			st = null;
			reader = new BufferedReader(new InputStreamReader(System.in));
		}

		public String next() throws IOException {
			if (st == null || !st.hasMoreElements()) {
				st = new StringTokenizer(reader.readLine());
			}
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			st = null;
			String readLine = null;
			readLine = reader.readLine();
			return readLine;
		}

		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		public int[] nextIntArr(int n) throws NumberFormatException, IOException {
			int[] retArr = new int[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextInt();
			}
			return retArr;
		}

		public long[] nextLongArr(int n) throws NumberFormatException, IOException {
			long[] retArr = new long[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextLong();
			}
			return retArr;
		}

		public void close() throws IOException {
			reader.close();
		}
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.StringTokenizer; StringTokenizer java.util public class Main {
	
	String dream = "dream";
	String dreamer = "dreamer";
	String erase = "erase";
	String eraser = "eraser";

	public static void main(String[] args) throws IOException {
		Main mainObj = new Main();
		mainObj.solve();
	}

	public void solve() throws IOException {
		FastScanner fs = new FastScanner();
		
		String s = fs.next();
		
		int index = 0;
		boolean yes = true;
		
		while(index < s.length()) {
			int retIndex;
			if(s.charAt(index) == 'e') {
				retIndex = checkEraseOrEraser(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else if(s.charAt(index) == 'd') {
				retIndex = checkDreamOrDreamer(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else {
				yes = false;
				break;
			}
				
			
		}
		
		if(yes) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}
	
	
	int checkDreamOrDreamer(String s, int index) {
		
		int beforeIndex = 0;
		for(; beforeIndex < dream.length() && beforeIndex + index < s.length(); beforeIndex++) {
			if(s.charAt(index + beforeIndex) != dream.charAt(beforeIndex)) {
				return -1;
			}
		}
		
		if(beforeIndex < dream.length()) {
			return -1;
		}
		
		int afterIndex = 0;
		for(; afterIndex < 3 && index + dream.length() + afterIndex < s.length(); afterIndex++) {
			if(s.charAt(index + dream.length() + afterIndex) != eraser.charAt(afterIndex)) {
				break;
			}
		}
		
		if(afterIndex == 2) {
			return index + dream.length()+2;
		}else {
			return index +dream.length() ;
		}
	}
	
	int checkEraseOrEraser(String s, int index) {
		int beforeIndex = 0;
		for(; beforeIndex < erase.length() && beforeIndex + index < s.length(); beforeIndex++) {
			if(s.charAt(index + beforeIndex) != erase.charAt(beforeIndex)) {
				return -1;
			}
		}
		
		if(beforeIndex < erase.length()) {
			return -1;
		}
		
		int afterIndex = 0;
		for(; afterIndex < 2 && index + erase.length() + afterIndex < s.length(); afterIndex++) {
			if(s.charAt(index + erase.length() + afterIndex) != eraser.charAt(afterIndex+1)) {
				break;
			}
		}
		
		if(afterIndex == 1) {
			return index + erase.length()+1;
		}else {
			return index +erase.length() ;
		}
	}

	

	public class FastScanner {

		BufferedReader reader;
		private StringTokenizer st;

		public FastScanner() {
			st = null;
			reader = new BufferedReader(new InputStreamReader(System.in));
		}

		public String next() throws IOException {
			if (st == null || !st.hasMoreElements()) {
				st = new StringTokenizer(reader.readLine());
			}
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			st = null;
			String readLine = null;
			readLine = reader.readLine();
			return readLine;
		}

		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		public int[] nextIntArr(int n) throws NumberFormatException, IOException {
			int[] retArr = new int[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextInt();
			}
			return retArr;
		}

		public long[] nextLongArr(int n) throws NumberFormatException, IOException {
			long[] retArr = new long[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextLong();
			}
			return retArr;
		}

		public void close() throws IOException {
			reader.close();
		}
	}

} Main String dream = "dream"; dream "dream" String dreamer = "dreamer"; dreamer "dreamer" String erase = "erase"; erase "erase" String eraser = "eraser"; eraser "eraser" public static void main(String[] args) throws IOException {
		Main mainObj = new Main();
		mainObj.solve();
	} main {
		Main mainObj = new Main();
		mainObj.solve();
	} Main mainObj = new Main(); mainObj new Main() mainObj.solve() mainObj.solve mainObj String[] args args public void solve() throws IOException {
		FastScanner fs = new FastScanner();
		
		String s = fs.next();
		
		int index = 0;
		boolean yes = true;
		
		while(index < s.length()) {
			int retIndex;
			if(s.charAt(index) == 'e') {
				retIndex = checkEraseOrEraser(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else if(s.charAt(index) == 'd') {
				retIndex = checkDreamOrDreamer(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else {
				yes = false;
				break;
			}
				
			
		}
		
		if(yes) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	} solve {
		FastScanner fs = new FastScanner();
		
		String s = fs.next();
		
		int index = 0;
		boolean yes = true;
		
		while(index < s.length()) {
			int retIndex;
			if(s.charAt(index) == 'e') {
				retIndex = checkEraseOrEraser(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else if(s.charAt(index) == 'd') {
				retIndex = checkDreamOrDreamer(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else {
				yes = false;
				break;
			}
				
			
		}
		
		if(yes) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	} FastScanner fs = new FastScanner(); fs new FastScanner() String s = fs.next(); s fs.next() fs.next fs int index = 0; index 0 boolean yes = true; yes true while(index < s.length()) {
			int retIndex;
			if(s.charAt(index) == 'e') {
				retIndex = checkEraseOrEraser(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else if(s.charAt(index) == 'd') {
				retIndex = checkDreamOrDreamer(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else {
				yes = false;
				break;
			}
				
			
		} index < s.length() index s.length() s.length s {
			int retIndex;
			if(s.charAt(index) == 'e') {
				retIndex = checkEraseOrEraser(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else if(s.charAt(index) == 'd') {
				retIndex = checkDreamOrDreamer(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else {
				yes = false;
				break;
			}
				
			
		} int retIndex; retIndex if(s.charAt(index) == 'e') {
				retIndex = checkEraseOrEraser(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else if(s.charAt(index) == 'd') {
				retIndex = checkDreamOrDreamer(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else {
				yes = false;
				break;
			} s.charAt(index) == 'e' s.charAt(index) s.charAt s index 'e' {
				retIndex = checkEraseOrEraser(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			} retIndex = checkEraseOrEraser(s, index) retIndex checkEraseOrEraser(s, index) checkEraseOrEraser s index if(retIndex == -1) {
					yes = false;
					break;
				} retIndex == -1 retIndex -1 1 {
					yes = false;
					break;
				} yes = false yes false break; index = retIndex index retIndex if(s.charAt(index) == 'd') {
				retIndex = checkDreamOrDreamer(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else {
				yes = false;
				break;
			} s.charAt(index) == 'd' s.charAt(index) s.charAt s index 'd' {
				retIndex = checkDreamOrDreamer(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			} retIndex = checkDreamOrDreamer(s, index) retIndex checkDreamOrDreamer(s, index) checkDreamOrDreamer s index if(retIndex == -1) {
					yes = false;
					break;
				} retIndex == -1 retIndex -1 1 {
					yes = false;
					break;
				} yes = false yes false break; index = retIndex index retIndex {
				yes = false;
				break;
			} yes = false yes false break; if(yes) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		} yes {
			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" int checkDreamOrDreamer(String s, int index) {
		
		int beforeIndex = 0;
		for(; beforeIndex < dream.length() && beforeIndex + index < s.length(); beforeIndex++) {
			if(s.charAt(index + beforeIndex) != dream.charAt(beforeIndex)) {
				return -1;
			}
		}
		
		if(beforeIndex < dream.length()) {
			return -1;
		}
		
		int afterIndex = 0;
		for(; afterIndex < 3 && index + dream.length() + afterIndex < s.length(); afterIndex++) {
			if(s.charAt(index + dream.length() + afterIndex) != eraser.charAt(afterIndex)) {
				break;
			}
		}
		
		if(afterIndex == 2) {
			return index + dream.length()+2;
		}else {
			return index +dream.length() ;
		}
	} checkDreamOrDreamer {
		
		int beforeIndex = 0;
		for(; beforeIndex < dream.length() && beforeIndex + index < s.length(); beforeIndex++) {
			if(s.charAt(index + beforeIndex) != dream.charAt(beforeIndex)) {
				return -1;
			}
		}
		
		if(beforeIndex < dream.length()) {
			return -1;
		}
		
		int afterIndex = 0;
		for(; afterIndex < 3 && index + dream.length() + afterIndex < s.length(); afterIndex++) {
			if(s.charAt(index + dream.length() + afterIndex) != eraser.charAt(afterIndex)) {
				break;
			}
		}
		
		if(afterIndex == 2) {
			return index + dream.length()+2;
		}else {
			return index +dream.length() ;
		}
	} int beforeIndex = 0; beforeIndex 0 for(; beforeIndex < dream.length() && beforeIndex + index < s.length(); beforeIndex++) {
			if(s.charAt(index + beforeIndex) != dream.charAt(beforeIndex)) {
				return -1;
			}
		} ; beforeIndex < dream.length() && beforeIndex + index < s.length() beforeIndex < dream.length() beforeIndex dream.length() dream.length dream beforeIndex + index < s.length() beforeIndex + index beforeIndex index s.length() s.length s beforeIndex++ beforeIndex++ beforeIndex {
			if(s.charAt(index + beforeIndex) != dream.charAt(beforeIndex)) {
				return -1;
			}
		} {
			if(s.charAt(index + beforeIndex) != dream.charAt(beforeIndex)) {
				return -1;
			}
		} if(s.charAt(index + beforeIndex) != dream.charAt(beforeIndex)) {
				return -1;
			} s.charAt(index + beforeIndex) != dream.charAt(beforeIndex) s.charAt(index + beforeIndex) s.charAt s index + beforeIndex index beforeIndex dream.charAt(beforeIndex) dream.charAt dream beforeIndex {
				return -1;
			} return -1; -1 1 if(beforeIndex < dream.length()) {
			return -1;
		} beforeIndex < dream.length() beforeIndex dream.length() dream.length dream {
			return -1;
		} return -1; -1 1 int afterIndex = 0; afterIndex 0 for(; afterIndex < 3 && index + dream.length() + afterIndex < s.length(); afterIndex++) {
			if(s.charAt(index + dream.length() + afterIndex) != eraser.charAt(afterIndex)) {
				break;
			}
		} ; afterIndex < 3 && index + dream.length() + afterIndex < s.length() afterIndex < 3 afterIndex 3 index + dream.length() + afterIndex < s.length() index + dream.length() + afterIndex index + dream.length() + afterIndex index dream.length() dream.length dream afterIndex s.length() s.length s afterIndex++ afterIndex++ afterIndex {
			if(s.charAt(index + dream.length() + afterIndex) != eraser.charAt(afterIndex)) {
				break;
			}
		} {
			if(s.charAt(index + dream.length() + afterIndex) != eraser.charAt(afterIndex)) {
				break;
			}
		} if(s.charAt(index + dream.length() + afterIndex) != eraser.charAt(afterIndex)) {
				break;
			} s.charAt(index + dream.length() + afterIndex) != eraser.charAt(afterIndex) s.charAt(index + dream.length() + afterIndex) s.charAt s index + dream.length() + afterIndex index + dream.length() + afterIndex index dream.length() dream.length dream afterIndex eraser.charAt(afterIndex) eraser.charAt eraser afterIndex {
				break;
			} break; if(afterIndex == 2) {
			return index + dream.length()+2;
		}else {
			return index +dream.length() ;
		} afterIndex == 2 afterIndex 2 {
			return index + dream.length()+2;
		} return index + dream.length()+2; index + dream.length()+2 index + dream.length()+2 index dream.length() dream.length dream 2 {
			return index +dream.length() ;
		} return index +dream.length() ; index +dream.length() index dream.length() dream.length dream String s s int index index int checkEraseOrEraser(String s, int index) {
		int beforeIndex = 0;
		for(; beforeIndex < erase.length() && beforeIndex + index < s.length(); beforeIndex++) {
			if(s.charAt(index + beforeIndex) != erase.charAt(beforeIndex)) {
				return -1;
			}
		}
		
		if(beforeIndex < erase.length()) {
			return -1;
		}
		
		int afterIndex = 0;
		for(; afterIndex < 2 && index + erase.length() + afterIndex < s.length(); afterIndex++) {
			if(s.charAt(index + erase.length() + afterIndex) != eraser.charAt(afterIndex+1)) {
				break;
			}
		}
		
		if(afterIndex == 1) {
			return index + erase.length()+1;
		}else {
			return index +erase.length() ;
		}
	} checkEraseOrEraser {
		int beforeIndex = 0;
		for(; beforeIndex < erase.length() && beforeIndex + index < s.length(); beforeIndex++) {
			if(s.charAt(index + beforeIndex) != erase.charAt(beforeIndex)) {
				return -1;
			}
		}
		
		if(beforeIndex < erase.length()) {
			return -1;
		}
		
		int afterIndex = 0;
		for(; afterIndex < 2 && index + erase.length() + afterIndex < s.length(); afterIndex++) {
			if(s.charAt(index + erase.length() + afterIndex) != eraser.charAt(afterIndex+1)) {
				break;
			}
		}
		
		if(afterIndex == 1) {
			return index + erase.length()+1;
		}else {
			return index +erase.length() ;
		}
	} int beforeIndex = 0; beforeIndex 0 for(; beforeIndex < erase.length() && beforeIndex + index < s.length(); beforeIndex++) {
			if(s.charAt(index + beforeIndex) != erase.charAt(beforeIndex)) {
				return -1;
			}
		} ; beforeIndex < erase.length() && beforeIndex + index < s.length() beforeIndex < erase.length() beforeIndex erase.length() erase.length erase beforeIndex + index < s.length() beforeIndex + index beforeIndex index s.length() s.length s beforeIndex++ beforeIndex++ beforeIndex {
			if(s.charAt(index + beforeIndex) != erase.charAt(beforeIndex)) {
				return -1;
			}
		} {
			if(s.charAt(index + beforeIndex) != erase.charAt(beforeIndex)) {
				return -1;
			}
		} if(s.charAt(index + beforeIndex) != erase.charAt(beforeIndex)) {
				return -1;
			} s.charAt(index + beforeIndex) != erase.charAt(beforeIndex) s.charAt(index + beforeIndex) s.charAt s index + beforeIndex index beforeIndex erase.charAt(beforeIndex) erase.charAt erase beforeIndex {
				return -1;
			} return -1; -1 1 if(beforeIndex < erase.length()) {
			return -1;
		} beforeIndex < erase.length() beforeIndex erase.length() erase.length erase {
			return -1;
		} return -1; -1 1 int afterIndex = 0; afterIndex 0 for(; afterIndex < 2 && index + erase.length() + afterIndex < s.length(); afterIndex++) {
			if(s.charAt(index + erase.length() + afterIndex) != eraser.charAt(afterIndex+1)) {
				break;
			}
		} ; afterIndex < 2 && index + erase.length() + afterIndex < s.length() afterIndex < 2 afterIndex 2 index + erase.length() + afterIndex < s.length() index + erase.length() + afterIndex index + erase.length() + afterIndex index erase.length() erase.length erase afterIndex s.length() s.length s afterIndex++ afterIndex++ afterIndex {
			if(s.charAt(index + erase.length() + afterIndex) != eraser.charAt(afterIndex+1)) {
				break;
			}
		} {
			if(s.charAt(index + erase.length() + afterIndex) != eraser.charAt(afterIndex+1)) {
				break;
			}
		} if(s.charAt(index + erase.length() + afterIndex) != eraser.charAt(afterIndex+1)) {
				break;
			} s.charAt(index + erase.length() + afterIndex) != eraser.charAt(afterIndex+1) s.charAt(index + erase.length() + afterIndex) s.charAt s index + erase.length() + afterIndex index + erase.length() + afterIndex index erase.length() erase.length erase afterIndex eraser.charAt(afterIndex+1) eraser.charAt eraser afterIndex+1 afterIndex 1 {
				break;
			} break; if(afterIndex == 1) {
			return index + erase.length()+1;
		}else {
			return index +erase.length() ;
		} afterIndex == 1 afterIndex 1 {
			return index + erase.length()+1;
		} return index + erase.length()+1; index + erase.length()+1 index + erase.length()+1 index erase.length() erase.length erase 1 {
			return index +erase.length() ;
		} return index +erase.length() ; index +erase.length() index erase.length() erase.length erase String s s int index index public class FastScanner {

		BufferedReader reader;
		private StringTokenizer st;

		public FastScanner() {
			st = null;
			reader = new BufferedReader(new InputStreamReader(System.in));
		}

		public String next() throws IOException {
			if (st == null || !st.hasMoreElements()) {
				st = new StringTokenizer(reader.readLine());
			}
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			st = null;
			String readLine = null;
			readLine = reader.readLine();
			return readLine;
		}

		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		public int[] nextIntArr(int n) throws NumberFormatException, IOException {
			int[] retArr = new int[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextInt();
			}
			return retArr;
		}

		public long[] nextLongArr(int n) throws NumberFormatException, IOException {
			long[] retArr = new long[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextLong();
			}
			return retArr;
		}

		public void close() throws IOException {
			reader.close();
		}
	} FastScanner BufferedReader reader; reader private StringTokenizer st; st public FastScanner() {
			st = null;
			reader = new BufferedReader(new InputStreamReader(System.in));
		} FastScanner {
			st = null;
			reader = new BufferedReader(new InputStreamReader(System.in));
		} st = null st null reader = new BufferedReader(new InputStreamReader(System.in)) reader new BufferedReader(new InputStreamReader(System.in)) public String next() throws IOException {
			if (st == null || !st.hasMoreElements()) {
				st = new StringTokenizer(reader.readLine());
			}
			return st.nextToken();
		} next {
			if (st == null || !st.hasMoreElements()) {
				st = new StringTokenizer(reader.readLine());
			}
			return st.nextToken();
		} if (st == null || !st.hasMoreElements()) {
				st = new StringTokenizer(reader.readLine());
			} st == null || !st.hasMoreElements() st == null st null !st.hasMoreElements() st.hasMoreElements() st.hasMoreElements st {
				st = new StringTokenizer(reader.readLine());
			} st = new StringTokenizer(reader.readLine()) st new StringTokenizer(reader.readLine()) return st.nextToken(); st.nextToken() st.nextToken st public String nextLine() throws IOException {
			st = null;
			String readLine = null;
			readLine = reader.readLine();
			return readLine;
		} nextLine {
			st = null;
			String readLine = null;
			readLine = reader.readLine();
			return readLine;
		} st = null st null String readLine = null; readLine null readLine = reader.readLine() readLine reader.readLine() reader.readLine reader return readLine; readLine public int nextInt() throws NumberFormatException, 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 NumberFormatException, IOException {
			return Long.parseLong(next());
		} nextLong {
			return Long.parseLong(next());
		} return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public int[] nextIntArr(int n) throws NumberFormatException, IOException {
			int[] retArr = new int[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextInt();
			}
			return retArr;
		} nextIntArr {
			int[] retArr = new int[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextInt();
			}
			return retArr;
		} int[] retArr = new int[n]; retArr new int[n] n for (int i = 0; i < n; i++) {
				retArr[i] = nextInt();
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				retArr[i] = nextInt();
			} {
				retArr[i] = nextInt();
			} retArr[i] = nextInt() retArr[i] retArr i nextInt() nextInt return retArr; retArr int n n public long[] nextLongArr(int n) throws NumberFormatException, IOException {
			long[] retArr = new long[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextLong();
			}
			return retArr;
		} nextLongArr {
			long[] retArr = new long[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextLong();
			}
			return retArr;
		} long[] retArr = new long[n]; retArr new long[n] n for (int i = 0; i < n; i++) {
				retArr[i] = nextLong();
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				retArr[i] = nextLong();
			} {
				retArr[i] = nextLong();
			} retArr[i] = nextLong() retArr[i] retArr i nextLong() nextLong return retArr; retArr int n n public void close() throws IOException {
			reader.close();
		} close {
			reader.close();
		} reader.close() reader.close reader public class Main {
	
	String dream = "dream";
	String dreamer = "dreamer";
	String erase = "erase";
	String eraser = "eraser";

	public static void main(String[] args) throws IOException {
		Main mainObj = new Main();
		mainObj.solve();
	}

	public void solve() throws IOException {
		FastScanner fs = new FastScanner();
		
		String s = fs.next();
		
		int index = 0;
		boolean yes = true;
		
		while(index < s.length()) {
			int retIndex;
			if(s.charAt(index) == 'e') {
				retIndex = checkEraseOrEraser(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else if(s.charAt(index) == 'd') {
				retIndex = checkDreamOrDreamer(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else {
				yes = false;
				break;
			}
				
			
		}
		
		if(yes) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}
	
	
	int checkDreamOrDreamer(String s, int index) {
		
		int beforeIndex = 0;
		for(; beforeIndex < dream.length() && beforeIndex + index < s.length(); beforeIndex++) {
			if(s.charAt(index + beforeIndex) != dream.charAt(beforeIndex)) {
				return -1;
			}
		}
		
		if(beforeIndex < dream.length()) {
			return -1;
		}
		
		int afterIndex = 0;
		for(; afterIndex < 3 && index + dream.length() + afterIndex < s.length(); afterIndex++) {
			if(s.charAt(index + dream.length() + afterIndex) != eraser.charAt(afterIndex)) {
				break;
			}
		}
		
		if(afterIndex == 2) {
			return index + dream.length()+2;
		}else {
			return index +dream.length() ;
		}
	}
	
	int checkEraseOrEraser(String s, int index) {
		int beforeIndex = 0;
		for(; beforeIndex < erase.length() && beforeIndex + index < s.length(); beforeIndex++) {
			if(s.charAt(index + beforeIndex) != erase.charAt(beforeIndex)) {
				return -1;
			}
		}
		
		if(beforeIndex < erase.length()) {
			return -1;
		}
		
		int afterIndex = 0;
		for(; afterIndex < 2 && index + erase.length() + afterIndex < s.length(); afterIndex++) {
			if(s.charAt(index + erase.length() + afterIndex) != eraser.charAt(afterIndex+1)) {
				break;
			}
		}
		
		if(afterIndex == 1) {
			return index + erase.length()+1;
		}else {
			return index +erase.length() ;
		}
	}

	

	public class FastScanner {

		BufferedReader reader;
		private StringTokenizer st;

		public FastScanner() {
			st = null;
			reader = new BufferedReader(new InputStreamReader(System.in));
		}

		public String next() throws IOException {
			if (st == null || !st.hasMoreElements()) {
				st = new StringTokenizer(reader.readLine());
			}
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			st = null;
			String readLine = null;
			readLine = reader.readLine();
			return readLine;
		}

		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		public int[] nextIntArr(int n) throws NumberFormatException, IOException {
			int[] retArr = new int[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextInt();
			}
			return retArr;
		}

		public long[] nextLongArr(int n) throws NumberFormatException, IOException {
			long[] retArr = new long[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextLong();
			}
			return retArr;
		}

		public void close() throws IOException {
			reader.close();
		}
	}

} public class Main {
	
	String dream = "dream";
	String dreamer = "dreamer";
	String erase = "erase";
	String eraser = "eraser";

	public static void main(String[] args) throws IOException {
		Main mainObj = new Main();
		mainObj.solve();
	}

	public void solve() throws IOException {
		FastScanner fs = new FastScanner();
		
		String s = fs.next();
		
		int index = 0;
		boolean yes = true;
		
		while(index < s.length()) {
			int retIndex;
			if(s.charAt(index) == 'e') {
				retIndex = checkEraseOrEraser(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else if(s.charAt(index) == 'd') {
				retIndex = checkDreamOrDreamer(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else {
				yes = false;
				break;
			}
				
			
		}
		
		if(yes) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}
	
	
	int checkDreamOrDreamer(String s, int index) {
		
		int beforeIndex = 0;
		for(; beforeIndex < dream.length() && beforeIndex + index < s.length(); beforeIndex++) {
			if(s.charAt(index + beforeIndex) != dream.charAt(beforeIndex)) {
				return -1;
			}
		}
		
		if(beforeIndex < dream.length()) {
			return -1;
		}
		
		int afterIndex = 0;
		for(; afterIndex < 3 && index + dream.length() + afterIndex < s.length(); afterIndex++) {
			if(s.charAt(index + dream.length() + afterIndex) != eraser.charAt(afterIndex)) {
				break;
			}
		}
		
		if(afterIndex == 2) {
			return index + dream.length()+2;
		}else {
			return index +dream.length() ;
		}
	}
	
	int checkEraseOrEraser(String s, int index) {
		int beforeIndex = 0;
		for(; beforeIndex < erase.length() && beforeIndex + index < s.length(); beforeIndex++) {
			if(s.charAt(index + beforeIndex) != erase.charAt(beforeIndex)) {
				return -1;
			}
		}
		
		if(beforeIndex < erase.length()) {
			return -1;
		}
		
		int afterIndex = 0;
		for(; afterIndex < 2 && index + erase.length() + afterIndex < s.length(); afterIndex++) {
			if(s.charAt(index + erase.length() + afterIndex) != eraser.charAt(afterIndex+1)) {
				break;
			}
		}
		
		if(afterIndex == 1) {
			return index + erase.length()+1;
		}else {
			return index +erase.length() ;
		}
	}

	

	public class FastScanner {

		BufferedReader reader;
		private StringTokenizer st;

		public FastScanner() {
			st = null;
			reader = new BufferedReader(new InputStreamReader(System.in));
		}

		public String next() throws IOException {
			if (st == null || !st.hasMoreElements()) {
				st = new StringTokenizer(reader.readLine());
			}
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			st = null;
			String readLine = null;
			readLine = reader.readLine();
			return readLine;
		}

		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		public int[] nextIntArr(int n) throws NumberFormatException, IOException {
			int[] retArr = new int[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextInt();
			}
			return retArr;
		}

		public long[] nextLongArr(int n) throws NumberFormatException, IOException {
			long[] retArr = new long[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextLong();
			}
			return retArr;
		}

		public void close() throws IOException {
			reader.close();
		}
	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
	
	String dream = "dream";
	String dreamer = "dreamer";
	String erase = "erase";
	String eraser = "eraser";

	public static void main(String[] args) throws IOException {
		Main mainObj = new Main();
		mainObj.solve();
	}

	public void solve() throws IOException {
		FastScanner fs = new FastScanner();
		
		String s = fs.next();
		
		int index = 0;
		boolean yes = true;
		
		while(index < s.length()) {
			int retIndex;
			if(s.charAt(index) == 'e') {
				retIndex = checkEraseOrEraser(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else if(s.charAt(index) == 'd') {
				retIndex = checkDreamOrDreamer(s, index);
				if(retIndex == -1) {
					yes = false;
					break;
				}
				index = retIndex;
			}else {
				yes = false;
				break;
			}
				
			
		}
		
		if(yes) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}
	
	
	int checkDreamOrDreamer(String s, int index) {
		
		int beforeIndex = 0;
		for(; beforeIndex < dream.length() && beforeIndex + index < s.length(); beforeIndex++) {
			if(s.charAt(index + beforeIndex) != dream.charAt(beforeIndex)) {
				return -1;
			}
		}
		
		if(beforeIndex < dream.length()) {
			return -1;
		}
		
		int afterIndex = 0;
		for(; afterIndex < 3 && index + dream.length() + afterIndex < s.length(); afterIndex++) {
			if(s.charAt(index + dream.length() + afterIndex) != eraser.charAt(afterIndex)) {
				break;
			}
		}
		
		if(afterIndex == 2) {
			return index + dream.length()+2;
		}else {
			return index +dream.length() ;
		}
	}
	
	int checkEraseOrEraser(String s, int index) {
		int beforeIndex = 0;
		for(; beforeIndex < erase.length() && beforeIndex + index < s.length(); beforeIndex++) {
			if(s.charAt(index + beforeIndex) != erase.charAt(beforeIndex)) {
				return -1;
			}
		}
		
		if(beforeIndex < erase.length()) {
			return -1;
		}
		
		int afterIndex = 0;
		for(; afterIndex < 2 && index + erase.length() + afterIndex < s.length(); afterIndex++) {
			if(s.charAt(index + erase.length() + afterIndex) != eraser.charAt(afterIndex+1)) {
				break;
			}
		}
		
		if(afterIndex == 1) {
			return index + erase.length()+1;
		}else {
			return index +erase.length() ;
		}
	}

	

	public class FastScanner {

		BufferedReader reader;
		private StringTokenizer st;

		public FastScanner() {
			st = null;
			reader = new BufferedReader(new InputStreamReader(System.in));
		}

		public String next() throws IOException {
			if (st == null || !st.hasMoreElements()) {
				st = new StringTokenizer(reader.readLine());
			}
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			st = null;
			String readLine = null;
			readLine = reader.readLine();
			return readLine;
		}

		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		public int[] nextIntArr(int n) throws NumberFormatException, IOException {
			int[] retArr = new int[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextInt();
			}
			return retArr;
		}

		public long[] nextLongArr(int n) throws NumberFormatException, IOException {
			long[] retArr = new long[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextLong();
			}
			return retArr;
		}

		public void close() throws IOException {
			reader.close();
		}
	}

}
