A concentration inequality for product spaces