import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String ans = S.replace("dreameraser", "0");
		String ans2 = ans.replace("dreamerase", "0");
		String ans3 = ans2.replace("dreamer", "0");
		String ans4 = ans3.replace("dream", "0");
		String ans5 = ans4.replace("eraser", "0");
		String ans6 = ans5.replace("erase", "0");
		String ans7 = ans6.replace("0", "");
		System.out.println(ans7.equals("") ? "YES" :"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();
		String ans = S.replace("dreameraser", "0");
		String ans2 = ans.replace("dreamerase", "0");
		String ans3 = ans2.replace("dreamer", "0");
		String ans4 = ans3.replace("dream", "0");
		String ans5 = ans4.replace("eraser", "0");
		String ans6 = ans5.replace("erase", "0");
		String ans7 = ans6.replace("0", "");
		System.out.println(ans7.equals("") ? "YES" :"NO");
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String ans = S.replace("dreameraser", "0");
		String ans2 = ans.replace("dreamerase", "0");
		String ans3 = ans2.replace("dreamer", "0");
		String ans4 = ans3.replace("dream", "0");
		String ans5 = ans4.replace("eraser", "0");
		String ans6 = ans5.replace("erase", "0");
		String ans7 = ans6.replace("0", "");
		System.out.println(ans7.equals("") ? "YES" :"NO");
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String ans = S.replace("dreameraser", "0");
		String ans2 = ans.replace("dreamerase", "0");
		String ans3 = ans2.replace("dreamer", "0");
		String ans4 = ans3.replace("dream", "0");
		String ans5 = ans4.replace("eraser", "0");
		String ans6 = ans5.replace("erase", "0");
		String ans7 = ans6.replace("0", "");
		System.out.println(ans7.equals("") ? "YES" :"NO");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc String ans = S.replace("dreameraser", "0"); ans S.replace("dreameraser", "0") S.replace S "dreameraser" "0" String ans2 = ans.replace("dreamerase", "0"); ans2 ans.replace("dreamerase", "0") ans.replace ans "dreamerase" "0" String ans3 = ans2.replace("dreamer", "0"); ans3 ans2.replace("dreamer", "0") ans2.replace ans2 "dreamer" "0" String ans4 = ans3.replace("dream", "0"); ans4 ans3.replace("dream", "0") ans3.replace ans3 "dream" "0" String ans5 = ans4.replace("eraser", "0"); ans5 ans4.replace("eraser", "0") ans4.replace ans4 "eraser" "0" String ans6 = ans5.replace("erase", "0"); ans6 ans5.replace("erase", "0") ans5.replace ans5 "erase" "0" String ans7 = ans6.replace("0", ""); ans7 ans6.replace("0", "") ans6.replace ans6 "0" "" System.out.println(ans7.equals("") ? "YES" :"NO") System.out.println System.out System System.out ans7.equals("") ? "YES" :"NO" ans7.equals("") ans7.equals ans7 "" "YES" "NO" String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String ans = S.replace("dreameraser", "0");
		String ans2 = ans.replace("dreamerase", "0");
		String ans3 = ans2.replace("dreamer", "0");
		String ans4 = ans3.replace("dream", "0");
		String ans5 = ans4.replace("eraser", "0");
		String ans6 = ans5.replace("erase", "0");
		String ans7 = ans6.replace("0", "");
		System.out.println(ans7.equals("") ? "YES" :"NO");
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String ans = S.replace("dreameraser", "0");
		String ans2 = ans.replace("dreamerase", "0");
		String ans3 = ans2.replace("dreamer", "0");
		String ans4 = ans3.replace("dream", "0");
		String ans5 = ans4.replace("eraser", "0");
		String ans6 = ans5.replace("erase", "0");
		String ans7 = ans6.replace("0", "");
		System.out.println(ans7.equals("") ? "YES" :"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();
		String ans = S.replace("dreameraser", "0");
		String ans2 = ans.replace("dreamerase", "0");
		String ans3 = ans2.replace("dreamer", "0");
		String ans4 = ans3.replace("dream", "0");
		String ans5 = ans4.replace("eraser", "0");
		String ans6 = ans5.replace("erase", "0");
		String ans7 = ans6.replace("0", "");
		System.out.println(ans7.equals("") ? "YES" :"NO");
	}
}