S&P 500 and Nasdaq Composite notch longest streak of gains in two years