import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int position =0;
		while (position<s.length()) {
			if (position+5>s.length()) {
				System.out.println("NO");
				return ;
			}
			if ("dream".equals(s.substring(position,position+5))==false&&"erase".equals(s.substring(position,position+5))==false) {
				System.out.println("NO");
				return ;
			}
			position+=5;
			if (s.charAt(position-1)=='m') {
				if (position+2<=s.length()) {
					if ("er".equals(s.substring(position,position+2))==false ) {
						continue;
					}
					if (position+2<s.length()&&(s.charAt(position+2)=='e'||s.charAt(position+2)=='d')) {
						position +=2;
					} else if (position+2==s.length()){
						position +=2;
					}
				}
			} else {
				if (position<s.length()) {
					if (s.charAt(position)=='r') {
						position +=1;
					}
				}
			}

		}
		System.out.println("YES");
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int position =0;
		while (position<s.length()) {
			if (position+5>s.length()) {
				System.out.println("NO");
				return ;
			}
			if ("dream".equals(s.substring(position,position+5))==false&&"erase".equals(s.substring(position,position+5))==false) {
				System.out.println("NO");
				return ;
			}
			position+=5;
			if (s.charAt(position-1)=='m') {
				if (position+2<=s.length()) {
					if ("er".equals(s.substring(position,position+2))==false ) {
						continue;
					}
					if (position+2<s.length()&&(s.charAt(position+2)=='e'||s.charAt(position+2)=='d')) {
						position +=2;
					} else if (position+2==s.length()){
						position +=2;
					}
				}
			} else {
				if (position<s.length()) {
					if (s.charAt(position)=='r') {
						position +=1;
					}
				}
			}

		}
		System.out.println("YES");
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int position =0;
		while (position<s.length()) {
			if (position+5>s.length()) {
				System.out.println("NO");
				return ;
			}
			if ("dream".equals(s.substring(position,position+5))==false&&"erase".equals(s.substring(position,position+5))==false) {
				System.out.println("NO");
				return ;
			}
			position+=5;
			if (s.charAt(position-1)=='m') {
				if (position+2<=s.length()) {
					if ("er".equals(s.substring(position,position+2))==false ) {
						continue;
					}
					if (position+2<s.length()&&(s.charAt(position+2)=='e'||s.charAt(position+2)=='d')) {
						position +=2;
					} else if (position+2==s.length()){
						position +=2;
					}
				}
			} else {
				if (position<s.length()) {
					if (s.charAt(position)=='r') {
						position +=1;
					}
				}
			}

		}
		System.out.println("YES");
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int position =0;
		while (position<s.length()) {
			if (position+5>s.length()) {
				System.out.println("NO");
				return ;
			}
			if ("dream".equals(s.substring(position,position+5))==false&&"erase".equals(s.substring(position,position+5))==false) {
				System.out.println("NO");
				return ;
			}
			position+=5;
			if (s.charAt(position-1)=='m') {
				if (position+2<=s.length()) {
					if ("er".equals(s.substring(position,position+2))==false ) {
						continue;
					}
					if (position+2<s.length()&&(s.charAt(position+2)=='e'||s.charAt(position+2)=='d')) {
						position +=2;
					} else if (position+2==s.length()){
						position +=2;
					}
				}
			} else {
				if (position<s.length()) {
					if (s.charAt(position)=='r') {
						position +=1;
					}
				}
			}

		}
		System.out.println("YES");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int position =0; position 0 while (position<s.length()) {
			if (position+5>s.length()) {
				System.out.println("NO");
				return ;
			}
			if ("dream".equals(s.substring(position,position+5))==false&&"erase".equals(s.substring(position,position+5))==false) {
				System.out.println("NO");
				return ;
			}
			position+=5;
			if (s.charAt(position-1)=='m') {
				if (position+2<=s.length()) {
					if ("er".equals(s.substring(position,position+2))==false ) {
						continue;
					}
					if (position+2<s.length()&&(s.charAt(position+2)=='e'||s.charAt(position+2)=='d')) {
						position +=2;
					} else if (position+2==s.length()){
						position +=2;
					}
				}
			} else {
				if (position<s.length()) {
					if (s.charAt(position)=='r') {
						position +=1;
					}
				}
			}

		} position<s.length() position s.length() s.length s {
			if (position+5>s.length()) {
				System.out.println("NO");
				return ;
			}
			if ("dream".equals(s.substring(position,position+5))==false&&"erase".equals(s.substring(position,position+5))==false) {
				System.out.println("NO");
				return ;
			}
			position+=5;
			if (s.charAt(position-1)=='m') {
				if (position+2<=s.length()) {
					if ("er".equals(s.substring(position,position+2))==false ) {
						continue;
					}
					if (position+2<s.length()&&(s.charAt(position+2)=='e'||s.charAt(position+2)=='d')) {
						position +=2;
					} else if (position+2==s.length()){
						position +=2;
					}
				}
			} else {
				if (position<s.length()) {
					if (s.charAt(position)=='r') {
						position +=1;
					}
				}
			}

		} if (position+5>s.length()) {
				System.out.println("NO");
				return ;
			} position+5>s.length() position+5 position 5 s.length() s.length s {
				System.out.println("NO");
				return ;
			} System.out.println("NO") System.out.println System.out System System.out "NO" return ; if ("dream".equals(s.substring(position,position+5))==false&&"erase".equals(s.substring(position,position+5))==false) {
				System.out.println("NO");
				return ;
			} "dream".equals(s.substring(position,position+5))==false&&"erase".equals(s.substring(position,position+5))==false "dream".equals(s.substring(position,position+5))==false "dream".equals(s.substring(position,position+5)) "dream".equals "dream" s.substring(position,position+5) s.substring s position position+5 position 5 false "erase".equals(s.substring(position,position+5))==false "erase".equals(s.substring(position,position+5)) "erase".equals "erase" s.substring(position,position+5) s.substring s position position+5 position 5 false {
				System.out.println("NO");
				return ;
			} System.out.println("NO") System.out.println System.out System System.out "NO" return ; position+=5 position 5 if (s.charAt(position-1)=='m') {
				if (position+2<=s.length()) {
					if ("er".equals(s.substring(position,position+2))==false ) {
						continue;
					}
					if (position+2<s.length()&&(s.charAt(position+2)=='e'||s.charAt(position+2)=='d')) {
						position +=2;
					} else if (position+2==s.length()){
						position +=2;
					}
				}
			} else {
				if (position<s.length()) {
					if (s.charAt(position)=='r') {
						position +=1;
					}
				}
			} s.charAt(position-1)=='m' s.charAt(position-1) s.charAt s position-1 position 1 'm' {
				if (position+2<=s.length()) {
					if ("er".equals(s.substring(position,position+2))==false ) {
						continue;
					}
					if (position+2<s.length()&&(s.charAt(position+2)=='e'||s.charAt(position+2)=='d')) {
						position +=2;
					} else if (position+2==s.length()){
						position +=2;
					}
				}
			} if (position+2<=s.length()) {
					if ("er".equals(s.substring(position,position+2))==false ) {
						continue;
					}
					if (position+2<s.length()&&(s.charAt(position+2)=='e'||s.charAt(position+2)=='d')) {
						position +=2;
					} else if (position+2==s.length()){
						position +=2;
					}
				} position+2<=s.length() position+2 position 2 s.length() s.length s {
					if ("er".equals(s.substring(position,position+2))==false ) {
						continue;
					}
					if (position+2<s.length()&&(s.charAt(position+2)=='e'||s.charAt(position+2)=='d')) {
						position +=2;
					} else if (position+2==s.length()){
						position +=2;
					}
				} if ("er".equals(s.substring(position,position+2))==false ) {
						continue;
					} "er".equals(s.substring(position,position+2))==false "er".equals(s.substring(position,position+2)) "er".equals "er" s.substring(position,position+2) s.substring s position position+2 position 2 false {
						continue;
					} continue; if (position+2<s.length()&&(s.charAt(position+2)=='e'||s.charAt(position+2)=='d')) {
						position +=2;
					} else if (position+2==s.length()){
						position +=2;
					} position+2<s.length()&&(s.charAt(position+2)=='e'||s.charAt(position+2)=='d') position+2<s.length() position+2 position 2 s.length() s.length s (s.charAt(position+2)=='e'||s.charAt(position+2)=='d') s.charAt(position+2)=='e' s.charAt(position+2) s.charAt s position+2 position 2 'e' s.charAt(position+2)=='d' s.charAt(position+2) s.charAt s position+2 position 2 'd' {
						position +=2;
					} position +=2 position 2 if (position+2==s.length()){
						position +=2;
					} position+2==s.length() position+2 position 2 s.length() s.length s {
						position +=2;
					} position +=2 position 2 {
				if (position<s.length()) {
					if (s.charAt(position)=='r') {
						position +=1;
					}
				}
			} if (position<s.length()) {
					if (s.charAt(position)=='r') {
						position +=1;
					}
				} position<s.length() position s.length() s.length s {
					if (s.charAt(position)=='r') {
						position +=1;
					}
				} if (s.charAt(position)=='r') {
						position +=1;
					} s.charAt(position)=='r' s.charAt(position) s.charAt s position 'r' {
						position +=1;
					} position +=1 position 1 System.out.println("YES") System.out.println System.out System System.out "YES" String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int position =0;
		while (position<s.length()) {
			if (position+5>s.length()) {
				System.out.println("NO");
				return ;
			}
			if ("dream".equals(s.substring(position,position+5))==false&&"erase".equals(s.substring(position,position+5))==false) {
				System.out.println("NO");
				return ;
			}
			position+=5;
			if (s.charAt(position-1)=='m') {
				if (position+2<=s.length()) {
					if ("er".equals(s.substring(position,position+2))==false ) {
						continue;
					}
					if (position+2<s.length()&&(s.charAt(position+2)=='e'||s.charAt(position+2)=='d')) {
						position +=2;
					} else if (position+2==s.length()){
						position +=2;
					}
				}
			} else {
				if (position<s.length()) {
					if (s.charAt(position)=='r') {
						position +=1;
					}
				}
			}

		}
		System.out.println("YES");
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int position =0;
		while (position<s.length()) {
			if (position+5>s.length()) {
				System.out.println("NO");
				return ;
			}
			if ("dream".equals(s.substring(position,position+5))==false&&"erase".equals(s.substring(position,position+5))==false) {
				System.out.println("NO");
				return ;
			}
			position+=5;
			if (s.charAt(position-1)=='m') {
				if (position+2<=s.length()) {
					if ("er".equals(s.substring(position,position+2))==false ) {
						continue;
					}
					if (position+2<s.length()&&(s.charAt(position+2)=='e'||s.charAt(position+2)=='d')) {
						position +=2;
					} else if (position+2==s.length()){
						position +=2;
					}
				}
			} else {
				if (position<s.length()) {
					if (s.charAt(position)=='r') {
						position +=1;
					}
				}
			}

		}
		System.out.println("YES");
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int position =0;
		while (position<s.length()) {
			if (position+5>s.length()) {
				System.out.println("NO");
				return ;
			}
			if ("dream".equals(s.substring(position,position+5))==false&&"erase".equals(s.substring(position,position+5))==false) {
				System.out.println("NO");
				return ;
			}
			position+=5;
			if (s.charAt(position-1)=='m') {
				if (position+2<=s.length()) {
					if ("er".equals(s.substring(position,position+2))==false ) {
						continue;
					}
					if (position+2<s.length()&&(s.charAt(position+2)=='e'||s.charAt(position+2)=='d')) {
						position +=2;
					} else if (position+2==s.length()){
						position +=2;
					}
				}
			} else {
				if (position<s.length()) {
					if (s.charAt(position)=='r') {
						position +=1;
					}
				}
			}

		}
		System.out.println("YES");
	}
}