S&P 500 closes at first record high in over two years as tech fuels U.S. stocks