In a successful test earlier this month, North Korea fired four missiles into the Sea of Japan, heightening concerns about its nuclear weapons program. As Victor Cha, a former Bush administration adviser, recently said of the missile tests, “This is now a military testing program to acquire a proven capability.”

The tests continue to raise the stakes for President Trump, who indicated before he took office that North Korea acquiring long-range, nuclear-armed ballistic missiles is something that “won’t happen.” Trump’s blunt message and the urgency of the international response are understandable. But although its nuclear weapons present a threat today to its neighbors, and likely down the road to the United States homeland, North Korea also provides two important lessons that the United States could use to reorient its foreign policy in a more useful direction.

The first lesson is that neither the United States, nor the international community, can solve every problem that occurs in the world. Many problems do have solutions, and there is every reason to try to find reasonable solutions to pressing challenges — especially those involving peace and security — before acknowledging that they cannot be resolved. But some problems simply do not have solutions, or at least none that would come at a reasonable price.

North Korea’s nuclear program appears to be one of the latter problems. The United States and the international community tried hard throughout the 1990s to keep North Korea from pursuing nuclear weapons, but eventually those efforts failed. More than 20 years later, it is clear that North Korea’s nuclear weapons are here to stay.

Not only is there little reason to expect diplomatic solutions to work today where they failed before, but any military option has long since passed beyond the realm of thinkable. One does not attack nuclear-armed nations; the risk of catastrophe is simply too great.

The obvious implication of this first lesson is that at this point, the United States needs to stop trying to roll back North Korea’s nuclear program.

More fundamentally, the United States needs to consider which of the many foreign policy problems it has identified can be solved, and which cannot.

The second lesson from North Korea is that the U.S. needs to think much harder about the limits of military intervention and the unintended consequences of maintaining a forward military presence in troubled spots around the world.

North Korea’s famously paranoid style often makes Pyongyang seem unhinged, but what nation wouldn’t be worried with tens of thousands of well-armed American troops staring across the demilitarized zone?

North Korea might have developed nuclear weapons even if the U.S. had not stationed troops in South Korea, but Americans should not be blind to the proliferation incentives created by the sustained presence of U.S. military forces since the Korean War. And today the only reason a North Korean nuclear program presents any real threat to the United States is because of the continued U.S. presence in South Korea.

North Korea’s nuclear program is no longer a problem that can be solved at a reasonable cost. Though nobody is happy about this, trying too hard to roll back this fact carries a real chance of making things worse.