Hindsight Preference Optimization