S&P 500, Nasdaq hit records on vaccine optimism