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