# copy trên mạng
n, k = [int(v) for v in input().split()]
a = [i for i in range(1, n + 1)]
b = [0] * n
if (k == 0):
print(*a)
elif (n // k % 2 == 0 and n % k == 0):
for i in range(0, n - 1, k * 2):
for x in range(i, i + k):
b[x] = a[x] + k
for y in range(i + k, i + 2 * k):
b[y] = a[y] - k
n, k = [int(v) for v in input().split()]
a = [i for i in range(1, n + 1)]
b = [0] * n
if (k == 0):
print(*a)
elif (n // k % 2 == 0 and n % k == 0):
for i in range(0, n - 1, k * 2):
for x in range(i, i + k):
b[x] = a[x] + k
for y in range(i + k, i + 2 * k):
b[y] = a[y] - k
print(*b)
else:
print(-1)