fun main (args : Array<String>) {
	
	val rs = readLine()
	val s = rs.toString()
	var revs = s.reversed()
	
	var rt : String = ""
	var t : String = ""
	
	for (str in revs) {
		rt += str
		
		if (rt in listOf("maerd")) {
			t += "maerd"
			rt = ""
		} else if (rt in listOf("remaerd")) {
			t += "remaerd"
			rt = ""
		} else if (rt in listOf("esare")) {
			t += "esare"
			rt = ""
		} else if (rt in listOf("resare")) {
			t += "resare"
			rt = ""
		} 
		
	}
	
	t = t.reversed()
	
	if (t == s) {
		println("YES")
	} else {
		println("NO")
	}
	
}