Stocks on Wall Street closed with modest gains Wednesday, driving the S&P 500 and Nasdaq to all-time highs for the second day in a row. Financial and energy companies led the way higher among stocks in the S&P 500. The benchmark index rose 0.2 percent, marking its fifth straight gain. A rise in bond yields, which allows lenders to charge higher interest rates on loans, helped push bank stocks higher. Health care and technology companies were among the laggards. The market’s latest gains came as earnings season continues to wind down and investors wait to hear from the Federal Reserve the next couple of days, when central bank officials hold their annual symposium. Wall Street is keen to gain new insight on the Fed’s view of the economy and what action, if any, it is considering taking to tackle rising inflation. “Earnings are rising, inflation is moderate and interest rates …