Wall Street gains amid AI optimism