S&P 500, Dow track second straight weekly gain on stimulus optimism