(Reuters) - Wall Street climbed on Tuesday for a third straight session, buoyed by Amazon.com and Apple, while investors focused on inflation data on Wednesday that could upset the market’s fragile recovery - or clear the way for additional gains.

Amazon.com AMZN.O rose 2 percent while Apple AAPL.O added 1 percent, both helping the S&P 500 shake off a negative open to the session and climb 0.26 percent by the close.

Investors said data on U.S. consumer prices and retail sales due out on Wednesday will be key to where stocks move in the short term. Inflation and interest-rate fears sparked a stock market rout after U.S. jobs data was released on Feb. 2.

Rob Haworth, a senior investment strategist at U.S. Bank Wealth Management, said the market’s recovery from a negative start earlier in the session was a good sign, but that it remained too soon to predict the market’s return to stability.

“We think we’re going to be volatile for a few more trading days at least, as the market sorts out what’s really been going on,” Haworth said.

Among the biggest movers was sportswear retailer Under Armour UAA.N, up more than 17.36 percent on strong quarterly sales, and AmerisourceBergen ABC.N, up 9.30 percent after the Wall Street Journal reported Walgreens WBA.O was seeking to buy out the drug distributor.

Cleveland Fed President Loretta Mester, a voting member in the central bank’s rate-setting committee this year, said the recent stock market sell-off and jump in volatility will not damage the economy’s overall strong prospects.

Traders work on the floor of the New York Stock Exchange shortly after the opening bell in New York, U.S., February 13, 2018. REUTERS/Lucas Jackson

Following a slump into correction territory last week, the S&P 500 has recovered 3.2 percent in the past three session. It remains down 7.3 percent from a record high on Jan 26 and is currently priced at levels first reached in early December.

The Dow Jones Industrial Average .DJI rose 0.16 percent to end at 24,640.45 points, while the S&P 500 .SPX gained 6.94 points to close at 2,662.94.

The Nasdaq Composite .IXIC added 0.45 percent to 7,013.51.

Nine of the 11 major S&P indexes rose, led by real estate .SPLRCR, up 0.54 percent.

Benchmark U.S. 10-year Treasury yields US10YT=RR dipped to 2.842 percent, shy of a four-year peak of 2.9020 percent hit on Monday.

The CBOE Volatility Index .VIX, a widely-followed measure of short-term stock volatility and seen as a contributing factor itself to the sell-off, was last at 25.3 points, half the 50-point mark it touched last week.

Following Wall Street’s recent swings, the S&P 500 is down 0.4 percent for the year. The tech-heavy Nasdaq is up 1.6 percent in 2018.

On a day of heavy trading in healthcare companies, Henry Schein HSIC.O and Patterson Companies PDCO.O fell 6.64 percent and 5.19 percent, respectively, after news of a U.S. Federal Trade Commission complaint against the dental supply firms.

Investors in those and other healthcare distributors are weighing the possible ramifications of the AmerisourceBergen deal and a report of Amazon's AMZN.O push into the sector.

Of the 70 percent of the S&P 500 companies that have reported earnings, nearly 78 percent of them topped profit expectations, according to Thomson Reuters data. That is above the 72 percent average beat-rate in the past four quarters.

Advancing issues outnumbered declining ones on the NYSE by a 1.31-to-1 ratio; on Nasdaq, a 1.48-to-1 ratio favored advancers.

About 6.4 billion shares changed hands in U.S. exchanges on Friday, below the 8.4 billion daily average over the last 20 sessions.