S&P, Nasdaq tick higher as strong earnings outweigh inflation fears