Once, after the Olympiad in Economics, Misha had a very colorful and unusual dream. The boy turned out to be the Minister of Finance of Berland. Realizing his importance, he immediately decided to reform the country. Earlier in Berland, banknotes with denominations of 1, 10, 100 and 1000 burles were used. Misha found this system extremely commonplace, so he decided to come up with something of his own.

The boy chose two integers x and y (x ≤ y) and announced that now only banknotes with denominations x, x + 1, x + 2, …, y burles will be used in Berland. Soon the reform was adopted and came into force, but the population of the country did not like it at all. Discontent began due to the fact that now, using new banknotes, it was not possible to collect any amount.

For example, if Misha chose the numbers x = 5 and y = 7, then it is impossible to collect the sums of 1, 2, 3 and 4 burles. Also, you will not be able to collect the sums of 8 and 9 burles. If we choose the numbers x = y = 2, then it will be impossible to collect any odd amount.

Misha, on the verge of dismissal, decided to calm the population of Berland and present such a minimum number N that with the help of new banknotes it is possible to collect any amount, starting from N. Thus, it should be possible to collect the sums N burles, N + 1 burles, N + 2 burles, and so on. Help Misha find the required number N and avoid getting fired.

Input data

The first line of the input contains an integer x - the minimum denomination of new banknotes.

The second line contains an integer y (1 ≤ x ≤ y ≤ 2 × 109) - the maximum denomination of new banknotes.

Output

Print one natural number N - the minimum number such that using banknotes with denominations x, x + 1, x + 2, …, y you can type any amount, starting with N burles.

If there is no such number, print −1 as the answer.

Please note that the answer can be quite large, so you should use a 64-bit data type, for example long long in C / C ++, long in Java and C #, int64 in Pascal.