main :: IO ()
main = do
  str <- getLine
  putStrLn $ if solve (reverse str) then "YES" else "NO"

solve :: String -> Bool
solve [] = True
solve str
  | length str < 5 = False
  | length5Str == "maerd" || length5Str == "esare" = solve (drop 5 str)
  | length6Str == "resare" = solve (drop 6 str)
  | length7Str == "remaerd" = solve (drop 7 str)
  | otherwise = False
  where
    length5Str = take 5 str
    length6Str = take 6 str
    length7Str = take 7 str
