Turn Game 2

Decide whether turn wins of weights 1, 3, 5, ... can give Yunho x and Donghyeok y points, minimizing Yunho's wins.

Medium5MathGreedyNumber theoryNo attempts yetTime limit2sMemory limit512 MB

Problem

Yunho and Donghyeok are at an algorithm camp. When a problem will not come out, they take a break and play a game.

The game is made of turns, and each turn is won by one of the two players. Turns are numbered from 1, and the winner of turn ii earns 2i12i-1 points.

The total number of turns is not fixed. Any number of turns is possible, including zero.

You are given two integers xx and yy. Decide whether Yunho can end with xx points and Donghyeok with yy points. If that is possible, also find the smallest number of turns Yunho has to win.

Input

The first line contains two integers xx and yy. (0x,y10120 \le x, y \le 10^{12})

Output

Print the smallest number of turns Yunho has to win. If scores xx and yy are impossible, print -1.