Do not let anyone tell you the stock market lacks a sense of humor.

The day after the only sitting socialist Senator won the New Hampshire Democratic primary to become the front-runner for his party’s nomination, stocks levitated to news highs. The Dow Jones Industrial Average gained nine-tenths of a percentage point, or 275 points, to hit a record close of 29551. The S&P 500 gained 0.65 percent and the Nasdaq Composite rose 0.9 percent, also setting new records.

Just in case the meaning of this was too obscure, investors made sure to bid up the price of health insurance companies whose business Sen. Bernie Sanders has promised to ban altogether as part of his scheme to extend government health insurance to everyone. United Health shares jumped 4.4 percent. Anthem shares soared 5.7 percent, Humana shares rose 5 percent, and Cigna climbed 3.4 percent.

Sanders has also promised to end the use of fossil fuels and to hold energy company executives criminally liable for, well, being energy company executives. On Tuesday the energy sector, which was the S&P 500’s weakest-performing sector, become one of the index’s biggest winners, rising 1 percent.

In other words, investors are convinced that there is little chance that Sanders will actually become president. What’s more, the rising possibility that he could win the nomination is seen as increasing the chances that President Donald Trump will win re-election.

“A Sanders nomination/contested convention increases the likelihood of a Trump victory and potentially even an all-Republican government, also a positive for stocks,” analysts at Raymond James wrote in a recent note to clients, according to Marketwatch.

Investors may be over-doing it. Certainly, Wall Street does not have a great track record when it comes to predicting the outcome of political contests. State Street Global Advisors’ deputy global chief investment officer, Lori Heinel, recently sounded the alarm in an interview with Marketwatch.

“I think investors are sort of sanguine about the idea that [President Donald] Trump will most likely win, and if you look at most of the analysis, they predict overwhelmingly that Trump will defeat any of the likely Democratic candidates,” Heinel said. “If that doesn’t happen or if it looks as though the Democratic candidates were gaining momentum, or depending upon which of the candidates it might be, the reversal in major policy imperatives would be quite dramatic.”