Amazon and Apple account for nearly half of all the S&P’s gains this year