Excluded-volume effects for a hadron gas in Yang-Mills theory