Problem: You are given positive integers X and Y. If there exists a positive integer not greater than 10^{18} that is a multiple of X but not a multiple of Y, choose one such integer and print it. If it does not exist, print -1.

Constraints

* 1 ≤ X,Y ≤ 10^9
* X and Y are integers.

Input

Input is given from Standard Input in the following format:


X Y


Output

Print a positive integer not greater than 10^{18} that is a multiple of X but not a multiple of Y, or print -1 if it does not exist.

Examples

Input

8 6


Output

16


Input

3 3


Output

-1

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
    void solve() throws IOException {
        long x = getLong();
        long y = getLong();
        if(x == y){
            System.out.println(-1);
            return;
        }
        for(long i = 2; i < 1000000; ++i){
            long res = (long)(x * i);
            if(res % y != 0){
                System.out.println(res);
                return;
            }
        }
        System.out.println(-1);
    }

    BufferedReader bufferedReader;
    PrintWriter output;
    StringTokenizer tokenizer;

    public static void main(String[] args) throws IOException {
        Main contest = new Main();
        contest.run();
    }

    public String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(bufferedReader.readLine());
        }
        return tokenizer.nextToken();
    }

    public int getInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    public long getLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    void run() throws IOException {
        bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        output = new PrintWriter(System.out);
        solve();
    }

}