import java.util.*;
class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		s=s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","");
		System.out.println(s.length()==0?"YES":"NO");
	}
} import java.util.*; util.* java class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		s=s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","");
		System.out.println(s.length()==0?"YES":"NO");
	}
} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		s=s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","");
		System.out.println(s.length()==0?"YES":"NO");
	} main {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		s=s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","");
		System.out.println(s.length()==0?"YES":"NO");
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) String s=sc.next(); s sc.next() sc.next sc s=s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","") s s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","") s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","") s.replaceAll("eraser","").replaceAll("erase","").replaceAll s.replaceAll("eraser","").replaceAll("erase","") s.replaceAll("eraser","").replaceAll s.replaceAll("eraser","") s.replaceAll s "eraser" "" "erase" "" "dreamer" "" "dream" "" System.out.println(s.length()==0?"YES":"NO") System.out.println System.out System System.out s.length()==0?"YES":"NO" s.length()==0 s.length() s.length s 0 "YES" "NO" String[] args args
import java.util.*;
class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		s=s.replaceAll("eraser","").replaceAll("erase","").replaceAll("dreamer","").replaceAll("dream","");
		System.out.println(s.length()==0?"YES":"NO");
	}
}
