S&P 500 posts best week in 2 months with 1.7% gain