New York's top court rules towns can ban fracking