North Korea said it will send athletes to the Winter Olympics in South Korea next month. Diplomats made that deal Tuesday during talks in the Korean demilitarized zone, the first between the two countries in more than two years. The South is asking the North to march together at the Olympics opening and closing ceremonies.

According to retired Adm. Sandy Winnefeld, CBS News military and homeland security analyst, it's "really easy to reach an agreement" when the two sides "desperately want something for different reasons."

"North Korea's part, they desperately wanted the legitimacy that's conferred by participating in the Olympic movement," said Winnefeld, who served as vice chairman of the Joint Chiefs of Staff from 2011 to 2015. "It would have been enormously humiliating for them had the Olympic spectacle been going on right across the border and they were not participating. And it feeds their message of we may have nuclear weapons but we're a normal nation and should be treated like that."

As for the South?

"They desperately would like to have a disturbance-free games, and even more importantly, they would like to not have participating nations scale back their athletes' participation out of concern for what might happen during the games," Winnefeld said.

While North Korean leader Kim Jong Un wants to be part of the Winter Games, he has not shown any interest in negotiating over his nuclear program. Winnefeld said the Olympics deal could bring "a little ray of sunshine" to the possibility of other talks, "but I would be very cautious about irrational exuberance here."

"The military exercises, for example, were postponed, not canceled," he said of joint U.S.-South Korea drills that will resume after the Olympics. "We still have two leaders that like to taunt each other and we still have a North Korea with a long history of manipulating negotiations like this," Winnefeld said.

On Twitter, President Trump tried to take credit for the Olympic agreement, writing that the talks wouldn't have happened "if I wasn't firm, strong and willing to commit our total 'might' against the North."

With all of the failed “experts” weighing in, does anybody really believe that talks and dialogue would be going on between North and South Korea right now if I wasn’t firm, strong and willing to commit our total “might” against the North. Fools, but talks are a good thing! — Donald J. Trump (@realDonaldTrump) January 4, 2018

Winnefeld appeared to disagree.

"I don't want to take anything away from the administration, but I do not believe that North Korea came to the table because they were intimidated or dragged to the table," Winnefeld said. "They came with a very specific purpose in mind and that is to regain some legitimacy out there in the real world, to avoid the humiliation of not participating in the games, and in the process, possibly cut in a little bit to the resolve that the international community might have towards future sanctions."