NEW YORK (Reuters) - The S&P 500 and Dow ended little changed on Monday, with energy and bank shares lower as Tropical Storm Harvey crippled the U.S. energy hub in Texas, while tech and healthcare gave a light boost to the Nasdaq.

Harvey, the most powerful hurricane to strike the southern U.S. state in more than 50 years when it came ashore on Friday, dumped more rain on Houston on Monday, and the flooding could worsen as engineers release water from overflowing reservoirs to keep it from jumping dams and surging uncontrollably.

Market analysts said despite the human drama and infrastructure devastation, the market could take solace in the fact that a massive rebuilding effort would mostly offset the negative economic consequences of the flooding.

U.S. crude futures CLc1 fell 2.5 percent to $46.68 per barrel over concerns that the refinery shutdowns could trigger an increase in crude inventories. Gasoline prices RBc1, however, rose.

Oil majors Exxon XOM.N and Chevron CVX.N were down 0.3 percent and 0.4 percent respectively. Refiner Valero Energy VLO.N climbed 1.1 percent.

Investors sought safe-haven assets, with gold XAU= rising to its highest in nearly 10 months.

But the search for safe havens was accompanied by stock picking in Home Depot HD.N, which rose 1.2 percent, and other companies likely to benefit from rebuilding efforts in the region.

“Home Depot will most certainly see a financial benefit from Hurricane Harvey, just as it did from Hurricane Sandy back in 2013,” said Neil Saunders, managing director of GlobalData Retail.

Insurer Travelers TRV.N was the largest drag on the Dow with a 2.6 percent drop to $123.23, while Allstate ALL.N fell 1.5 percent to $90.65 as investors assessed the likely impact of Harvey on the sector.

The S&P 500 financial sector .SPSY was the largest weight on the index, with a 0.5 percent drop.

“There tends to be initially a knee-jerk reaction and people react to the human side and the energy disruption, but that eases soon,” said Jim Paulsen, chief investment strategist at The Leuthold Group in Minneapolis, of the market’s reaction to the major storm and its aftermath.

“This is a massive human tragedy and the worst of it may not be over yet, but as far as stock market impact I don’t know if it is net-net a huge negative considering the fact it will bring in huge stimulus to the region.”

The Dow Jones Industrial Average .DJI fell 5.27 points, or 0.02 percent, to close at 21,808.4, the S&P 500 .SPX gained 1.19 points, or 0.05 percent, to 2,444.24

Traders work on the floor of the New York Stock Exchange (NYSE) in New York, U.S., August 25, 2017. REUTERS/Brendan McDermid

The Nasdaq Composite .IXIC added 17.37 points, or 0.28 percent, to 6,283.02 helped by rises in Apple AAPL.O and Gilead Sciences GILD.O.

Kite Pharmaceuticals KITE.O surged 28.0 percent to $178.05 after Gilead Sciences agreed to buy the immunotherapy developer in a deal valued at $11.9 billion. Shares of Gilead rose 1.2 percent.

Expedia EXPE.O fell 4.5 percent after an internal memo by the online travel services company said its CEO, Dara Khosrowshahi, has been asked to lead Uber [UBER.UL].

Declining issues outnumbered advancing ones on the NYSE by a 1.14-to-1 ratio; on Nasdaq, a 1.02-to-1 ratio favored decliners.

About 5.13 billion shares changed hands in U.S. exchanges, compared with the near 6 billion daily average over the last 20 sessions.