import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		String dream = "dream";
		String dreamer = "dreamer";
		String erase = "erase";
		String eraser = "eraser";
		String dreamerase = "dreamerase";
		String dreameraser = "dreameraser";

		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		scan.close();

		StringBuilder t = new StringBuilder(s);

		boolean yes = true;

		while(true) {
			int indexDream =  t.indexOf(dream);
			int indexDreamer = t.indexOf(dreamer);
			int indexErase = t.indexOf(erase);
			int indexEraser = t.indexOf(eraser);
			int indexDreamErase = t.indexOf(dreamerase);
			int indexDreamEraser = t.indexOf(dreameraser);

			if(indexDreamEraser == 0) {
				t.delete(0, dreameraser.length());
			} else if(indexDreamErase == 0) {
				t.delete(0, dreamerase.length());
			} else if(indexDreamer == 0){
				t.delete(0, dreamer.length());
			} else if(indexDream == 0) {
				t.delete(0, dream.length());
			} else if(indexEraser == 0) {
				t.delete(0, eraser.length());
			} else if(indexErase == 0) {
				t.delete(0, erase.length());
			} else {
				yes = false;
				break;
			}

			if(t.length() == 0) {
				break;
			}
		}

		if(yes == true) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		String dream = "dream";
		String dreamer = "dreamer";
		String erase = "erase";
		String eraser = "eraser";
		String dreamerase = "dreamerase";
		String dreameraser = "dreameraser";

		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		scan.close();

		StringBuilder t = new StringBuilder(s);

		boolean yes = true;

		while(true) {
			int indexDream =  t.indexOf(dream);
			int indexDreamer = t.indexOf(dreamer);
			int indexErase = t.indexOf(erase);
			int indexEraser = t.indexOf(eraser);
			int indexDreamErase = t.indexOf(dreamerase);
			int indexDreamEraser = t.indexOf(dreameraser);

			if(indexDreamEraser == 0) {
				t.delete(0, dreameraser.length());
			} else if(indexDreamErase == 0) {
				t.delete(0, dreamerase.length());
			} else if(indexDreamer == 0){
				t.delete(0, dreamer.length());
			} else if(indexDream == 0) {
				t.delete(0, dream.length());
			} else if(indexEraser == 0) {
				t.delete(0, eraser.length());
			} else if(indexErase == 0) {
				t.delete(0, erase.length());
			} else {
				yes = false;
				break;
			}

			if(t.length() == 0) {
				break;
			}
		}

		if(yes == true) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}

	}

} Main public static void main(String[] args) {
		String dream = "dream";
		String dreamer = "dreamer";
		String erase = "erase";
		String eraser = "eraser";
		String dreamerase = "dreamerase";
		String dreameraser = "dreameraser";

		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		scan.close();

		StringBuilder t = new StringBuilder(s);

		boolean yes = true;

		while(true) {
			int indexDream =  t.indexOf(dream);
			int indexDreamer = t.indexOf(dreamer);
			int indexErase = t.indexOf(erase);
			int indexEraser = t.indexOf(eraser);
			int indexDreamErase = t.indexOf(dreamerase);
			int indexDreamEraser = t.indexOf(dreameraser);

			if(indexDreamEraser == 0) {
				t.delete(0, dreameraser.length());
			} else if(indexDreamErase == 0) {
				t.delete(0, dreamerase.length());
			} else if(indexDreamer == 0){
				t.delete(0, dreamer.length());
			} else if(indexDream == 0) {
				t.delete(0, dream.length());
			} else if(indexEraser == 0) {
				t.delete(0, eraser.length());
			} else if(indexErase == 0) {
				t.delete(0, erase.length());
			} else {
				yes = false;
				break;
			}

			if(t.length() == 0) {
				break;
			}
		}

		if(yes == true) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}

	} main {
		String dream = "dream";
		String dreamer = "dreamer";
		String erase = "erase";
		String eraser = "eraser";
		String dreamerase = "dreamerase";
		String dreameraser = "dreameraser";

		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		scan.close();

		StringBuilder t = new StringBuilder(s);

		boolean yes = true;

		while(true) {
			int indexDream =  t.indexOf(dream);
			int indexDreamer = t.indexOf(dreamer);
			int indexErase = t.indexOf(erase);
			int indexEraser = t.indexOf(eraser);
			int indexDreamErase = t.indexOf(dreamerase);
			int indexDreamEraser = t.indexOf(dreameraser);

			if(indexDreamEraser == 0) {
				t.delete(0, dreameraser.length());
			} else if(indexDreamErase == 0) {
				t.delete(0, dreamerase.length());
			} else if(indexDreamer == 0){
				t.delete(0, dreamer.length());
			} else if(indexDream == 0) {
				t.delete(0, dream.length());
			} else if(indexEraser == 0) {
				t.delete(0, eraser.length());
			} else if(indexErase == 0) {
				t.delete(0, erase.length());
			} else {
				yes = false;
				break;
			}

			if(t.length() == 0) {
				break;
			}
		}

		if(yes == true) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}

	} String dream = "dream"; dream "dream" String dreamer = "dreamer"; dreamer "dreamer" String erase = "erase"; erase "erase" String eraser = "eraser"; eraser "eraser" String dreamerase = "dreamerase"; dreamerase "dreamerase" String dreameraser = "dreameraser"; dreameraser "dreameraser" Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String s = scan.next(); s scan.next() scan.next scan scan.close() scan.close scan StringBuilder t = new StringBuilder(s); t new StringBuilder(s) boolean yes = true; yes true while(true) {
			int indexDream =  t.indexOf(dream);
			int indexDreamer = t.indexOf(dreamer);
			int indexErase = t.indexOf(erase);
			int indexEraser = t.indexOf(eraser);
			int indexDreamErase = t.indexOf(dreamerase);
			int indexDreamEraser = t.indexOf(dreameraser);

			if(indexDreamEraser == 0) {
				t.delete(0, dreameraser.length());
			} else if(indexDreamErase == 0) {
				t.delete(0, dreamerase.length());
			} else if(indexDreamer == 0){
				t.delete(0, dreamer.length());
			} else if(indexDream == 0) {
				t.delete(0, dream.length());
			} else if(indexEraser == 0) {
				t.delete(0, eraser.length());
			} else if(indexErase == 0) {
				t.delete(0, erase.length());
			} else {
				yes = false;
				break;
			}

			if(t.length() == 0) {
				break;
			}
		} true {
			int indexDream =  t.indexOf(dream);
			int indexDreamer = t.indexOf(dreamer);
			int indexErase = t.indexOf(erase);
			int indexEraser = t.indexOf(eraser);
			int indexDreamErase = t.indexOf(dreamerase);
			int indexDreamEraser = t.indexOf(dreameraser);

			if(indexDreamEraser == 0) {
				t.delete(0, dreameraser.length());
			} else if(indexDreamErase == 0) {
				t.delete(0, dreamerase.length());
			} else if(indexDreamer == 0){
				t.delete(0, dreamer.length());
			} else if(indexDream == 0) {
				t.delete(0, dream.length());
			} else if(indexEraser == 0) {
				t.delete(0, eraser.length());
			} else if(indexErase == 0) {
				t.delete(0, erase.length());
			} else {
				yes = false;
				break;
			}

			if(t.length() == 0) {
				break;
			}
		} int indexDream =  t.indexOf(dream); indexDream t.indexOf(dream) t.indexOf t dream int indexDreamer = t.indexOf(dreamer); indexDreamer t.indexOf(dreamer) t.indexOf t dreamer int indexErase = t.indexOf(erase); indexErase t.indexOf(erase) t.indexOf t erase int indexEraser = t.indexOf(eraser); indexEraser t.indexOf(eraser) t.indexOf t eraser int indexDreamErase = t.indexOf(dreamerase); indexDreamErase t.indexOf(dreamerase) t.indexOf t dreamerase int indexDreamEraser = t.indexOf(dreameraser); indexDreamEraser t.indexOf(dreameraser) t.indexOf t dreameraser if(indexDreamEraser == 0) {
				t.delete(0, dreameraser.length());
			} else if(indexDreamErase == 0) {
				t.delete(0, dreamerase.length());
			} else if(indexDreamer == 0){
				t.delete(0, dreamer.length());
			} else if(indexDream == 0) {
				t.delete(0, dream.length());
			} else if(indexEraser == 0) {
				t.delete(0, eraser.length());
			} else if(indexErase == 0) {
				t.delete(0, erase.length());
			} else {
				yes = false;
				break;
			} indexDreamEraser == 0 indexDreamEraser 0 {
				t.delete(0, dreameraser.length());
			} t.delete(0, dreameraser.length()) t.delete t 0 dreameraser.length() dreameraser.length dreameraser if(indexDreamErase == 0) {
				t.delete(0, dreamerase.length());
			} else if(indexDreamer == 0){
				t.delete(0, dreamer.length());
			} else if(indexDream == 0) {
				t.delete(0, dream.length());
			} else if(indexEraser == 0) {
				t.delete(0, eraser.length());
			} else if(indexErase == 0) {
				t.delete(0, erase.length());
			} else {
				yes = false;
				break;
			} indexDreamErase == 0 indexDreamErase 0 {
				t.delete(0, dreamerase.length());
			} t.delete(0, dreamerase.length()) t.delete t 0 dreamerase.length() dreamerase.length dreamerase if(indexDreamer == 0){
				t.delete(0, dreamer.length());
			} else if(indexDream == 0) {
				t.delete(0, dream.length());
			} else if(indexEraser == 0) {
				t.delete(0, eraser.length());
			} else if(indexErase == 0) {
				t.delete(0, erase.length());
			} else {
				yes = false;
				break;
			} indexDreamer == 0 indexDreamer 0 {
				t.delete(0, dreamer.length());
			} t.delete(0, dreamer.length()) t.delete t 0 dreamer.length() dreamer.length dreamer if(indexDream == 0) {
				t.delete(0, dream.length());
			} else if(indexEraser == 0) {
				t.delete(0, eraser.length());
			} else if(indexErase == 0) {
				t.delete(0, erase.length());
			} else {
				yes = false;
				break;
			} indexDream == 0 indexDream 0 {
				t.delete(0, dream.length());
			} t.delete(0, dream.length()) t.delete t 0 dream.length() dream.length dream if(indexEraser == 0) {
				t.delete(0, eraser.length());
			} else if(indexErase == 0) {
				t.delete(0, erase.length());
			} else {
				yes = false;
				break;
			} indexEraser == 0 indexEraser 0 {
				t.delete(0, eraser.length());
			} t.delete(0, eraser.length()) t.delete t 0 eraser.length() eraser.length eraser if(indexErase == 0) {
				t.delete(0, erase.length());
			} else {
				yes = false;
				break;
			} indexErase == 0 indexErase 0 {
				t.delete(0, erase.length());
			} t.delete(0, erase.length()) t.delete t 0 erase.length() erase.length erase {
				yes = false;
				break;
			} yes = false yes false break; if(t.length() == 0) {
				break;
			} t.length() == 0 t.length() t.length t 0 {
				break;
			} break; if(yes == true) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		} yes == true yes true {
			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 {

	public static void main(String[] args) {
		String dream = "dream";
		String dreamer = "dreamer";
		String erase = "erase";
		String eraser = "eraser";
		String dreamerase = "dreamerase";
		String dreameraser = "dreameraser";

		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		scan.close();

		StringBuilder t = new StringBuilder(s);

		boolean yes = true;

		while(true) {
			int indexDream =  t.indexOf(dream);
			int indexDreamer = t.indexOf(dreamer);
			int indexErase = t.indexOf(erase);
			int indexEraser = t.indexOf(eraser);
			int indexDreamErase = t.indexOf(dreamerase);
			int indexDreamEraser = t.indexOf(dreameraser);

			if(indexDreamEraser == 0) {
				t.delete(0, dreameraser.length());
			} else if(indexDreamErase == 0) {
				t.delete(0, dreamerase.length());
			} else if(indexDreamer == 0){
				t.delete(0, dreamer.length());
			} else if(indexDream == 0) {
				t.delete(0, dream.length());
			} else if(indexEraser == 0) {
				t.delete(0, eraser.length());
			} else if(indexErase == 0) {
				t.delete(0, erase.length());
			} else {
				yes = false;
				break;
			}

			if(t.length() == 0) {
				break;
			}
		}

		if(yes == true) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}

	}

} public class Main {

	public static void main(String[] args) {
		String dream = "dream";
		String dreamer = "dreamer";
		String erase = "erase";
		String eraser = "eraser";
		String dreamerase = "dreamerase";
		String dreameraser = "dreameraser";

		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		scan.close();

		StringBuilder t = new StringBuilder(s);

		boolean yes = true;

		while(true) {
			int indexDream =  t.indexOf(dream);
			int indexDreamer = t.indexOf(dreamer);
			int indexErase = t.indexOf(erase);
			int indexEraser = t.indexOf(eraser);
			int indexDreamErase = t.indexOf(dreamerase);
			int indexDreamEraser = t.indexOf(dreameraser);

			if(indexDreamEraser == 0) {
				t.delete(0, dreameraser.length());
			} else if(indexDreamErase == 0) {
				t.delete(0, dreamerase.length());
			} else if(indexDreamer == 0){
				t.delete(0, dreamer.length());
			} else if(indexDream == 0) {
				t.delete(0, dream.length());
			} else if(indexEraser == 0) {
				t.delete(0, eraser.length());
			} else if(indexErase == 0) {
				t.delete(0, erase.length());
			} else {
				yes = false;
				break;
			}

			if(t.length() == 0) {
				break;
			}
		}

		if(yes == true) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		String dream = "dream";
		String dreamer = "dreamer";
		String erase = "erase";
		String eraser = "eraser";
		String dreamerase = "dreamerase";
		String dreameraser = "dreameraser";

		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		scan.close();

		StringBuilder t = new StringBuilder(s);

		boolean yes = true;

		while(true) {
			int indexDream =  t.indexOf(dream);
			int indexDreamer = t.indexOf(dreamer);
			int indexErase = t.indexOf(erase);
			int indexEraser = t.indexOf(eraser);
			int indexDreamErase = t.indexOf(dreamerase);
			int indexDreamEraser = t.indexOf(dreameraser);

			if(indexDreamEraser == 0) {
				t.delete(0, dreameraser.length());
			} else if(indexDreamErase == 0) {
				t.delete(0, dreamerase.length());
			} else if(indexDreamer == 0){
				t.delete(0, dreamer.length());
			} else if(indexDream == 0) {
				t.delete(0, dream.length());
			} else if(indexEraser == 0) {
				t.delete(0, eraser.length());
			} else if(indexErase == 0) {
				t.delete(0, erase.length());
			} else {
				yes = false;
				break;
			}

			if(t.length() == 0) {
				break;
			}
		}

		if(yes == true) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}

	}

}
