human
Dreamoon wants to climb up a stair of n steps. He can climb 1 or 2 steps at each move. Dreamoon wants the number of moves to be a multiple of an integer m. 

What is the minimal number of moves making him climb to the top of the stairs that satisfies his condition?

Input

The single line contains two space separated integers n, m (0 < n ≤ 10000, 1 < m ≤ 10).

Output

Print a single integer — the minimal number of moves being a multiple of m. If there is no way he can climb satisfying condition print  - 1 instead.

Examples

Input

10 2

Output

6

Input

3 5

Output

-1

Note

For the first sample, Dreamoon could climb in 6 moves with following sequence of steps: {2, 2, 2, 2, 1, 1}.

For the second sample, there are only three valid sequence of steps {2, 1}, {1, 2}, {1, 1, 1} with 2, 2, and 3 steps respectively. All these numbers are not multiples of 5.
Solve the task in PYTHON3.
assistant
#Here is Python code to print a single integer — the minimal number of moves being a multiple of m.

from sys import stdin, stdout

DEBUG = True

class Scan():
    def __init__(self):
        self.read = stdin.read
        self.input = stdin.readline

    def integer(self, count=1):
        if count == 1:
            return self._integer()
        return [self._integer() for _ in range(count)]

    def _integer(self):
        sym: str = self.read(1)
        while sym != '-' and not sym.isdigit():
            sym = self.read(1)
  
        number, sign = (0, -1) if sym == '-' else (int(sym), 1)
        sym: str = self.read(1)
        while sym.isdigit():
            number = number * 10 + int(sym)
            sym = self.read(1)
        
        return number * sign
    
    def array(self, func=int, sep=' '):
        if func == str:
            return input().split(sep)
        return list(map(func, input().split(sep)))

    def string(self, count=1):
        if count == 1:
            return self._string()
        return [self._string() for _ in range(count)]

    def _string(self):
        sym = self.read(1)
        while sym in ('\n', '\r', ' '):
            sym = self.read(1)
        
        s = str()
        while sym not in ('\n', '\r', ' '):
            s += sym
            sym = self.read(1)

        return s

class Write():
    pass

class Number():
    def gcd(a, b):
        while b > 0:
            a, b = b, a % b
        return a
    
    def lcm(a, b):
        return a * b // gcd(a, b)

    def sqrt(n):
        sqrt_n = int(n ** 0.5)
        while sqrt_n * sqrt_n < n:
            sqrt_n += 1

        while sqrt_n * sqrt_n > n:
            sqrt_n -= 1

        return sqrt_n
    
    def sum_n(n):
        return n * (n + 1) // 2

class Constants():
    EPS = 10 ** -9
    INF = 10 ** 18
    MOD = 10 ** 9 + 7

def solution(scan: Scan, write: Write):
    n, m = scan.integer(2)
    k = n // 2
    d = n % 2
    if (k + d) % m == 0:
        print(k + d)
    else:
        need = m - (k + d) % m 
        if need <= k:
            print(need + k + d)
        else:
            print(-1)

def main():
   ...