Faced with the prospect of a new apartment complex going up next door and blocking their view of the Empire State Building, a group of wealthy Manhattan condo owners in 2016 did something extraordinary: They decided to negotiate rather than litigate.

Together, the building’s residents offered developer Gary Barnett, who was behind the neighboring construction project, $11 million for the air rights over his land.

Residents on the upper floors, whose views would be most severely impacted, kicked in up to $1 million to finance the deal. Lower-floor residents paid less, while those on the ground floor paid nothing. Folks that didn’t have the cash right away relied on loans from neighbors. Without a single lawsuit or zoning board hearing, these condo owners got to keep their views, and Barnett got his money. It was a win-win.

Mutually beneficial trades over intangible views aren’t unprecedented, but they’re hardly common either, as Barnett himself told The New York Times. “Most of the time, they sue you and try and stop you somehow. These people stepped up to the plate and paid market value for the building rights,” said Barnett.

The deal these parties worked out among themselves is also a textbook example of the Coase Theorem. Named after the late British economist Ronald Coase, it holds that so long as property rights are clear and transaction costs are low, different parties with competing claims will be able to produce an efficient outcome through negotiation, without the need for government intervention. Importantly for Coase, it doesn’t matter which side holds the property rights.

In our example, the developer owned the air rights over his land, which he wanted to turn into new, profitable housing. If that were to happen, however, the existing condo owners next door would lose a view they also valued highly. Through their bargaining, we learned that the value the condo owners placed on their view exceeded what Barnett thought he could make from building apartments.

We would expect the same outcome even if the situation were flipped and the condo owners started with a right to their views of the Empire State Building. A developer could offer to buy that right from them. But unless he or she was willing to spend more than $11 million, the odds are that the building next door still wouldn’t be getting built.

This story offers a window into how “markets in everything” could reduce the incessant urban conflict between developers and their “not in my backyard” (NIMBY) foes. Most cities deal with the externalities of urban development through regulation. Rules are drawn up for how tall new buildings can be, what they have to look like, and even how much shadow they’re allowed to cast. These rules aim to address real problems, but they fail because they allow parties to get something for nothing.

A group of homeowners deeply concerned about their view or the traffic flow on their street need not pay a developer to build a smaller project on his land. Instead, they can ask the local planning department to withhold the developer’s permission. This is almost certainly cheaper, particularly when local laws give planners a great deal of power to deny or condition permits for new development.

In addition to being a win-lose proposition, this regulated approach also hides the value of urban land. Is our hypothetical homeowners’ view worth more than the return on a larger apartment complex? We’ll never know, because the negotiations that would have put a price tag on the view never took place. Crucial information about the most efficient use of urban land thus goes undiscovered.

So long as cities such as San Francisco, Seattle, Los Angeles, and New York give political power to opponents of new development, the negotiations that put prices on seemingly intangible things like views or sunlight will never happen. Developers and their opponents will be forced into politically driven, zero-sum planning and legal processes where only one party can come out on top.

It doesn’t have to be this way. As New York’s bargain-happy condo owners proved, property rights provide a way to solve these conflicts in a mutually beneficial way. NIMBYs can keep their views. They just have to pay for them.