MANCHESTER, N.H. — Andrew Yang, a Democratic businessman who campaigned on giving every adult American a monthly check for $1,000, will end his campaign for president after a disappointing showing in the New Hampshire primary.

“I am a numbers guy,” Yang said in an interview before addressing supporters at Manchester’s Puritan Backroom. “In most of these [upcoming] states, I’m not going to be at a threshold where I get delegates, which makes sticking around not necessarily helpful or productive in terms of furthering the goals of this campaign.”

Yang said he had not decided whether to endorse another candidate, though campaigns have reached out.

“If I become persuaded that there’s a particular candidate that gives us a superior chance of beating Donald Trump, and I think it's important to make that opinion known, then I would consider it for sure,” Yang said. He also said he would be open to becoming another candidate’s running mate or joining a presidential Cabinet.

Yang, 45, launched his campaign in November 2017 and celebrated his long-shot status as he polled higher and raised more money than many better-known candidates.

“I’ve already outlasted a dozen governors, former governors and members of Congress,” Yang said at a Monday night rally in New Hampshire’s biggest city.

In his stump speech, Yang warned of the societal and economic changes automation would continue to bring to the United States. He proposed countering it by implementing universal basic income in the form of a $1,000-a-month “freedom dividend” for U.S. citizens.

His sometimes bleak message on the campaign trail was contrasted with his upbeat, irreverent style of campaigning: Yang once crowd-surfed at a candidate forum and sometimes challenged other celebrities to pickup basketball games. He half-danced onto just about every stage to the ’90s Mark Morrison R&B hit “Return of the Mack” and spawned a loyal following of supporters who dubbed themselves the “Yang Gang.”

They often showed up at his events wearing trademark “math” hats, a nod both to his self-described emphasis on facts and research and to the geek culture that surrounded his candidacy. “This is the nerdiest campaign in history,” Yang told The Washington Post last year.

Yang, whose parents immigrated from Taiwan, is the latest nonwhite candidate to exit what started as a historically diverse Democratic field. On debate stages and on the campaign trail, Yang — perhaps the highest-profile East Asian presidential candidate in U.S. history — frequently made comments that suggested he was “good at math” or hard-working because he was Asian, which critics said perpetuated model-minority stereotypes.

Even after meeting with Asian American leaders, Yang defended his jokes about being Asian as his effort to reclaim those stereotypes.

After campaigning for more than two years, Yang finished a lackluster sixth place in the Feb. 3 Iowa caucuses, earning about 1 percent of the state delegate equivalents there. Afterward, his campaign fired dozens of staff members, including some senior-level directors.

“Anyone with a crystal ball would have regarded Iowa as a bit of a sinkhole,” Yang said. “If we could do it over again, of course, we would not have sunk so much energy and time and resources in Iowa. We would have been fighting it out here in New Hampshire. And then we probably would have been on the air in Nevada or South Carolina.”

Before the most recent Democratic debate last week, Yang set an ambitious fundraising goal of $2 million and told his supporters that he would have to finish in the top four in the New Hampshire primary or it would be “extremely challenging” to continue competing.

“If we miss this fundraising goal and our target finish in New Hampshire, I don’t believe we can continue contending at the same level,” Yang wrote in a fundraising email. “It’s that simple.”

As it became clear that he would not break through in New Hampshire, Yang sometimes became wistful. He told CNN on Monday that the concept of a freedom dividend was “not going anywhere, and emphasized on Tuesday that he had forced a new idea into Democratic politics. He made that point with math.

“Now, 66 percent of Democrats support a universal basic income,” Yang said. “It’s got 72 percent of young people, aged 18 to 34.”

Wang reported from Washington. Reis Thebault contributed to this report.