In less than three weeks, we will know who will be the next president of the United States. What kind of partner that president finds in Europe will depend substantially on the outcome of two elections in 2017: France’s presidential election in early May and Germany’s federal election by the end of October.

Of course, the United Kingdom’s exit from the European Union will have an impact on the future shape of Europe. The “hard Brexit” option that has gotten a lot of attention lately – particularly since British Prime Minister Theresa May announced her intention to focus on limiting immigration, even if it means losing access to the single market – would by itself change the way Europe functions.

As French Prime Minister Manuel Valls recently wrote, the key question facing Europe’s leaders is whether to “give up and leave the European project to a slow but certain death” or to “transform the EU.” Such a transformation would be no easy feat. It would require not only a new institutional vision for Europe, but also a major political restructuring, not least in France and Germany.

A viable institutional vision, which I described well before the Brexit vote, is to establish “two Europes in one.” The eurozone countries would form a more deeply integrated “Europe A,” while another group of countries would comprise a more diverse and loosely connected “Europe B.” The two Europes would be strongly linked, with some arrangements differing among the various members of Europe B. Together, the two Europes would be part of the post-Brexit “continental partnership,” which might eventually even replace the EU altogether.

It is a somewhat radical vision, one that can be fulfilled only if political forces are willing to embrace it, not least in France and Germany. Each country’s political leadership would need to be guided – indeed, energized – by the objective of saving “Europe.” Specifically, that means pursuing an economic policy that balances competitive markets and social solidarity, with substantial space for local diversity.

In both France and Germany, such a political dynamic would depend on an alliance of center-right and center-left pro-Europe forces – one that could overcome and ultimately dissipate each camp’s more extremist elements, thereby ensuring that anti-European political tendencies cannot block progress. To give a concrete – and provocative – example of what such a realignment might look like in France: a center-right President Alain Juppé could cooperate with a Prime Minister Emmanuel Macron trying to develop a “beyond the past” young center-left movement.

As for Germany, the center-right Christian Democratic Union (CDU) is, on the whole, insufficiently pro-European. Internally, it is limited by a conservative wing defined by views that are not compatible with long-term progress in Europe. Externally, it is limited by the far-right Alternative for Germany (AfD), which has lately grown in popularity.

In this context, even if Chancellor Angela Merkel’s CDU does emerge with the most votes next year, it will need help to build a new Europe, with more joint responsibilities for countries in Europe A and flexible arrangements with countries in Europe B. Specifically, the pro-European elements of the CDU must work with allies on the left – namely, most of the Social Democrats and the Greens.

Such an informal coalition has often allowed pro-Merkel projects to win support in Parliament, despite opposition from right-wing elements of the CDU. But, to save Europe, it must become deeper and more reliable, with common goals dominating a shared agenda.

The need for a realignment of political forces is not unique to France and Germany. There is a broad need for reformist and realistic globalizers to join forces to take on populist movements seeking to twist nostalgia into extreme nationalism, built almost exclusively on identity politics.

The world has changed substantially in recent decades, and Europe is no exception. It makes little sense to expect the old alignments to be able to respond adequately to today’s policy needs or political dynamics. Consider how difficult it has been for Spain to find a new majority – a two-year-long process that has yet to end.

Against this background, a political reshuffling is almost inevitable; the party shifts and conflicts that have characterized the ongoing US presidential election exemplify this. But that reshuffling could lead to a number of outcomes. To secure a positive, open, and prosperous future for Europe, it is critical that the forces that come out on top are those that recognize the huge benefits of politically and economically open societies, as well as the need for national and global public policies to promote more inclusion.

But even if progressive center-right and center-left forces manage to overcome their backward-looking counterparts, it will not be enough. The traditional political structure always risks being taken hostage or outflanked by identity-focused populists. That is why forward-thinking political groups must overcome their differences in a more structural manner to advance a new institutional vision of Europe.

Such a deep political restructuring aimed at building new progressive majorities will be difficult, and it will not happen overnight. But it is Europe’s only option. Without it, “Europe” will die, and the assault on economic openness and democratic values will continue to gain traction around the world – with potentially devastating consequences.