
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		
		StringBuilder sb = new StringBuilder();
		
		String t = sb.append(s).reverse().toString();
		
		
		t = t.replaceAll("resare", "1");
		t = t.replaceAll("esare", "1");
		t = t.replaceAll("remaerd", "1");
		t = t.replaceAll("maerd", "1");
		t = t.replaceAll("1", "");
		
		
		if(t.equals("")){
			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) {
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		
		StringBuilder sb = new StringBuilder();
		
		String t = sb.append(s).reverse().toString();
		
		
		t = t.replaceAll("resare", "1");
		t = t.replaceAll("esare", "1");
		t = t.replaceAll("remaerd", "1");
		t = t.replaceAll("maerd", "1");
		t = t.replaceAll("1", "");
		
		
		if(t.equals("")){
			System.out.println("YES");
		}
		else {
			System.out.println("NO");
		}
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		
		StringBuilder sb = new StringBuilder();
		
		String t = sb.append(s).reverse().toString();
		
		
		t = t.replaceAll("resare", "1");
		t = t.replaceAll("esare", "1");
		t = t.replaceAll("remaerd", "1");
		t = t.replaceAll("maerd", "1");
		t = t.replaceAll("1", "");
		
		
		if(t.equals("")){
			System.out.println("YES");
		}
		else {
			System.out.println("NO");
		}
	} main {
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		
		StringBuilder sb = new StringBuilder();
		
		String t = sb.append(s).reverse().toString();
		
		
		t = t.replaceAll("resare", "1");
		t = t.replaceAll("esare", "1");
		t = t.replaceAll("remaerd", "1");
		t = t.replaceAll("maerd", "1");
		t = t.replaceAll("1", "");
		
		
		if(t.equals("")){
			System.out.println("YES");
		}
		else {
			System.out.println("NO");
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc StringBuilder sb = new StringBuilder(); sb new StringBuilder() String t = sb.append(s).reverse().toString(); t sb.append(s).reverse().toString() sb.append(s).reverse().toString sb.append(s).reverse() sb.append(s).reverse sb.append(s) sb.append sb s t = t.replaceAll("resare", "1") t t.replaceAll("resare", "1") t.replaceAll t "resare" "1" t = t.replaceAll("esare", "1") t t.replaceAll("esare", "1") t.replaceAll t "esare" "1" t = t.replaceAll("remaerd", "1") t t.replaceAll("remaerd", "1") t.replaceAll t "remaerd" "1" t = t.replaceAll("maerd", "1") t t.replaceAll("maerd", "1") t.replaceAll t "maerd" "1" t = t.replaceAll("1", "") t t.replaceAll("1", "") t.replaceAll t "1" "" if(t.equals("")){
			System.out.println("YES");
		}
		else {
			System.out.println("NO");
		} t.equals("") t.equals t "" {
			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) {
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		
		StringBuilder sb = new StringBuilder();
		
		String t = sb.append(s).reverse().toString();
		
		
		t = t.replaceAll("resare", "1");
		t = t.replaceAll("esare", "1");
		t = t.replaceAll("remaerd", "1");
		t = t.replaceAll("maerd", "1");
		t = t.replaceAll("1", "");
		
		
		if(t.equals("")){
			System.out.println("YES");
		}
		else {
			System.out.println("NO");
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		
		StringBuilder sb = new StringBuilder();
		
		String t = sb.append(s).reverse().toString();
		
		
		t = t.replaceAll("resare", "1");
		t = t.replaceAll("esare", "1");
		t = t.replaceAll("remaerd", "1");
		t = t.replaceAll("maerd", "1");
		t = t.replaceAll("1", "");
		
		
		if(t.equals("")){
			System.out.println("YES");
		}
		else {
			System.out.println("NO");
		}
	}

} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		
		StringBuilder sb = new StringBuilder();
		
		String t = sb.append(s).reverse().toString();
		
		
		t = t.replaceAll("resare", "1");
		t = t.replaceAll("esare", "1");
		t = t.replaceAll("remaerd", "1");
		t = t.replaceAll("maerd", "1");
		t = t.replaceAll("1", "");
		
		
		if(t.equals("")){
			System.out.println("YES");
		}
		else {
			System.out.println("NO");
		}
	}

}
