let char_list_of_str s =
  let rec f res i = 
    if i < 0
    then res
    else f (s.[i]::res) @@ i-1
  in
  f [] (String.length s - 1)

let rec solve = function
  | []
      -> "YES"
  | 'e'::'r'::'a'::'s'::'e'::'r'::xs
  | 'e'::'r'::'a'::'s'::'e'::xs
  | 'd'::'r'::'e'::'a'::'m'::'e'::'r'::'a'::'s'::'e'::'r'::xs
  | 'd'::'r'::'e'::'a'::'m'::'e'::'r'::'a'::'s'::'e'::xs
  | 'd'::'r'::'e'::'a'::'m'::'e'::'r'::xs
  | 'd'::'r'::'e'::'a'::'m'::xs
      -> solve xs
  | _ -> "NO"

let () =
  Scanf.scanf "%s\n" char_list_of_str
  |> solve
  |> Printf.printf "%s\n"