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 str=s.reverse().toString();
		str=str.replaceAll("resare","");
		str=str.replaceAll("esare","");
		str=str.replaceAll("remaerd","");
		str=str.replaceAll("maerd","");
		
		if(str.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);
		StringBuffer s=new StringBuffer();
		s.append(sc.next());
		String str=s.reverse().toString();
		str=str.replaceAll("resare","");
		str=str.replaceAll("esare","");
		str=str.replaceAll("remaerd","");
		str=str.replaceAll("maerd","");
		
		if(str.equals(""))System.out.println("YES");
		else System.out.println("NO");
	}

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

}
