Finally, Bill de Blasio and I agree on something. He had a right to finish his workout at the Prospect Park YMCA without being confronted by a “homeless advocate” yelling in his face.

On this particular matter, I stand with the mayor. His language — “I’m not doing this here. I’m in the middle of a workout” — wasn’t callous. I don’t begrudge him his security crew, who kept the woman away from him as he left the gym.

But I’m glad de Blasio experienced a hint, however fleeting and relatively benign, of the encounters New Yorkers must suffer every day with the swelling legion of homeless often cursed with schizophrenia, addiction problems or violent impulses.

For the city’s law-abiding millions, every day is Halloween — but the ghouls are real. Deranged souls pop out of doorways and from under scaffolds. They scare the hell out of everyone who doesn’t enjoy de Blasio’s insulation from reality. Subways are the worst. No one knows when the raving character who’s “behaving erratically” will suddenly punch, stab or push you onto the tracks.

But the mayor rides in limousines. He routinely commandeered police helicopters until a public uproar drove him to travel on the ground.

In today’s “woke” climate, who wants to be fingered as heartless or racist? Certainly not de Blasio. He walks on eggs when it comes to the issue because 58 percent of people in city shelters are black and 31 percent Latino, according to the Coalition for the Homeless. The percentages for those living on streets are surely the same if not higher.

Internal e-mails recently unearthed by The Post and NY1 revealed that de Blasio rejected a plea by advisers in August 2015 to visit a homeless encampment in the South Bronx. His excuse: “The danger here is that it will be interpreted wrongly as an attack on the homeless.” De Blasio did visit the site a month later — after cops had sent the bums packing.

On the rare occasions he ventures underground, he’s shielded from the truth. In July 2017, The Post reported, cops booted the homeless from the Fourth Avenue-Ninth Street and Jay Street stations in Brooklyn before de Blasio passed through on a campaign tour.

De Blasio’s see-no-evil approach extends to the NYPD. How many crimes are committed by the street homeless? Incredibly, “Our data is not tracked to that level of specificity,” an NYPD spokesman told us.

Schizophrenic.nyc (yes there is such a website) says 20 to 35 percent of the homeless people in America suffer from some form of mental illness, compared to 6 percent of the total population. That surely underestimates the situation in New York City.

Homelessness due to impoverishment, family estrangement and/or mental illness is a human tragedy for which no one should be condemned. But the city’s homeless count has skyrocketed on de Blasio’s watch. The 62,000 in shelters are 79 percent more than just 10 years ago.

Many fewer live on the street, but we have a right to fear them. Their ranks swelled by 39 percent in 2017 over 2016, according to the Department of Homeless Services.

Their small-seeming numbers — 3,892 as counted last year — belie their disproportionate impact on public safety and on our civilized values. We’ve become desensitized to derelicts’ open sores and excrement even as we dread their next move.

De Blasio has done next to nothing to help. He’s built only half of the 10 new shelters he promised the city this year. He won’t force city prisons and hospitals to evaluate the mentally ill being released, although he has the authority to do so.

He’s yet to support strengthening the relatively toothless Kendra’s Law — a temporary measure named for Kendra Webdale, who was pushed to her death on the N-train track by schizophrenic Andrew Goldstein in 1999. It currently lets judges order psychiatric treatment for mentally disturbed people under certain conditions but doesn’t require them to take medication.

Goldstein was recently released from prison to a state mental-health facility and might one day be freed entirely.

Pray that he’s recovered. Because a mayor blind to the street madhouse won’t be any help if he hasn’t.