S&P 500 closes at five-year high