S&P, Nasdaq rebound as strong earnings outweigh inflation fears