Stock-market benchmarks booked modest gains Monday, but enough to push the Dow Jones Industrial Average and the S&P 500 further into record territory.