import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuffer s = new StringBuffer();
		s.append(sc.next());
		String S = s.reverse().toString();
		S = S.replaceAll("resare", "");
		S = S.replaceAll("esare", "");
		S = S.replaceAll("remaerd", "");
		S = S.replaceAll("maerd", "");
		if(S.length() != 0) {
			System.out.println("NO");
		} else {
			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);
		StringBuffer s = new StringBuffer();
		s.append(sc.next());
		String S = s.reverse().toString();
		S = S.replaceAll("resare", "");
		S = S.replaceAll("esare", "");
		S = S.replaceAll("remaerd", "");
		S = S.replaceAll("maerd", "");
		if(S.length() != 0) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuffer s = new StringBuffer();
		s.append(sc.next());
		String S = s.reverse().toString();
		S = S.replaceAll("resare", "");
		S = S.replaceAll("esare", "");
		S = S.replaceAll("remaerd", "");
		S = S.replaceAll("maerd", "");
		if(S.length() != 0) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
		}
	} main {
		Scanner sc = new Scanner(System.in);
		StringBuffer s = new StringBuffer();
		s.append(sc.next());
		String S = s.reverse().toString();
		S = S.replaceAll("resare", "");
		S = S.replaceAll("esare", "");
		S = S.replaceAll("remaerd", "");
		S = S.replaceAll("maerd", "");
		if(S.length() != 0) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuffer s = new StringBuffer(); s new StringBuffer() s.append(sc.next()) s.append s sc.next() sc.next sc String S = s.reverse().toString(); S s.reverse().toString() s.reverse().toString s.reverse() s.reverse s S = S.replaceAll("resare", "") S S.replaceAll("resare", "") S.replaceAll S "resare" "" S = S.replaceAll("esare", "") S S.replaceAll("esare", "") S.replaceAll S "esare" "" S = S.replaceAll("remaerd", "") S S.replaceAll("remaerd", "") S.replaceAll S "remaerd" "" S = S.replaceAll("maerd", "") S S.replaceAll("maerd", "") S.replaceAll S "maerd" "" if(S.length() != 0) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
		} S.length() != 0 S.length() S.length S 0 {
			System.out.println("NO");
		} System.out.println("NO") System.out.println System.out System System.out "NO" {
			System.out.println("YES");
		} 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);
		StringBuffer s = new StringBuffer();
		s.append(sc.next());
		String S = s.reverse().toString();
		S = S.replaceAll("resare", "");
		S = S.replaceAll("esare", "");
		S = S.replaceAll("remaerd", "");
		S = S.replaceAll("maerd", "");
		if(S.length() != 0) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuffer s = new StringBuffer();
		s.append(sc.next());
		String S = s.reverse().toString();
		S = S.replaceAll("resare", "");
		S = S.replaceAll("esare", "");
		S = S.replaceAll("remaerd", "");
		S = S.replaceAll("maerd", "");
		if(S.length() != 0) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuffer s = new StringBuffer();
		s.append(sc.next());
		String S = s.reverse().toString();
		S = S.replaceAll("resare", "");
		S = S.replaceAll("esare", "");
		S = S.replaceAll("remaerd", "");
		S = S.replaceAll("maerd", "");
		if(S.length() != 0) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
		}
	}
}
