Levko loves permutations very much. A permutation of length n is a sequence of distinct positive integers, each is at most n.

Let’s assume that value gcd(a, b) shows the greatest common divisor of numbers a and b. Levko assumes that element p_{i} of permutation p_1, p_2, ... , p_{n} is good if gcd(i, p_{i}) > 1. Levko considers a permutation beautiful, if it has exactly k good elements. Unfortunately, he doesn’t know any beautiful permutation. Your task is to help him to find at least one of them.


-----Input-----

The single line contains two integers n and k (1 ≤ n ≤ 10^5, 0 ≤ k ≤ n).


-----Output-----

In a single line print either any beautiful permutation or -1, if such permutation doesn’t exist.

If there are multiple suitable permutations, you are allowed to print any of them.


-----Examples-----
Input
4 2

Output
2 4 3 1
Input
1 1

Output
-1



-----Note-----

In the first sample elements 4 and 3 are good because gcd(2, 4) = 2 > 1 and gcd(3, 3) = 3 > 1. Elements 2 and 1 are not good because gcd(1, 2) = 1 and gcd(4, 1) = 1. As there are exactly 2 good elements, the permutation is beautiful.

The second sample has no beautiful permutations.

Source: codeforces | Difficulty: EASY
Tags: Number theory

Mathematics

Constructive algorithms


Solutions:
(n, k) = map(int, input().split())
ans = [i + 1 for i in range(n)]
if k == n:
	print(-1)
else:
	temp = n - k
	if temp == 1:
		print(*ans)
		exit()
	if temp % 2 == 1:
		temp -= 1
		for i in range(temp // 2):
			j = 2 * i + 1
			m = j + 1
			(ans[j], ans[m]) = (ans[m], ans[j])
		print(*ans)
	else:
		temp = temp // 2
		for i in range(temp):
			j = 2 * i
			m = j + 1
			(ans[j], ans[m]) = (ans[m], ans[j])
		print(*ans)


import sys
import math
import string
import operator
import functools
import fractions
import collections
sys.setrecursionlimit(10 ** 7)
dX = [-1, 1, 0, 0, -1, 1, -1, 1]
dY = [0, 0, -1, 1, 1, -1, -1, 1]
RI = lambda : list(map(int, input().split()))
RS = lambda : input().rstrip().split()
(n, k) = RI()
if n == k:
	print(-1)
else:
	print(n - k, end=' ')
	for i in range(1, n - k):
		print(i, end=' ')
	for i in range(n - k + 1, n + 1):
		print(i, end=' ')


(n, k) = map(int, input().split())
if n == k:
	print(-1)
	exit()
if k == n - 1:
	print(' '.join([str(b) for b in list(range(1, n + 1))]))
	exit()
res = []
for i in range(n - k):
	res.append((i + 1) % (n - k) + 1)
for i in range(n - k + 1, n + 1):
	res.append(i)
print(*res)


(n, k) = map(int, input().split())
if k >= n:
	print(-1)
elif k == n - 1:
	for i in range(n):
		print(i + 1, end=' ')
else:
	a = [0] * n
	for i in range(k + 1):
		a[i] = i + 1
	j = i + 1
	for i in range(j, n):
		a[i] = i + 2
	a[0] = j + 1
	a[-1] = 1
	print(*a)


(n, k) = map(int, input().split())
if n == k:
	print(-1)
else:
	rs = [0] * (n + 1)
	rs[1] = 1
	for i in range(2, k + 2):
		rs[i] = i
	for i in range(k + 2, n + 1):
		rs[i] = i + 1
	if k != n - 1:
		rs[n] = 1
		rs[1] = k + 2
	for i in range(1, n + 1):
		print(rs[i])


(n, k) = (int(i) for i in input().split())
if n == k:
	print(-1)
else:
	l = [n - k]
	for i in range(1, n - k):
		l += [i]
	for i in range(n - k + 1, n + 1):
		l += [i]
	print(*l)


(n, k) = list(map(int, input().split()))
if k == n:
	print(-1)
else:
	if 2 + k <= n:
		print(2 + k, end=' ')
	else:
		print(1, end=' ')
	for i in range(2, 2 + k):
		print(i, end=' ')
	i = 2 + k
	if i <= n:
		while i <= n - 1:
			print(i + 1, end=' ')
			i += 1
		print(1, end='')
	print()


from sys import stdout

def solve():
	(n, k) = map(int, input().rstrip().split())
	if k >= n:
		print(-1)
	else:
		ls = [i for i in range(1, n + 1)]
		k = n - k - 1
		swaps = k // 2
		i = 0
		while i < swaps:
			(ls[2 * i + 1], ls[2 * i + 2]) = (ls[2 * i + 2], ls[2 * i + 1])
			i += 1
		if k % 2 == 1:
			(ls[2 * i + 1], ls[0]) = (ls[0], ls[2 * i + 1])
		for elt in ls:
			stdout.write(str(elt) + ' ')
		print()
solve()


def k_beautiful(n, k):
	if n <= k:
		return [-1]
	else:
		beautiful = [i for i in range(1, n + 1)]
	left = n - k - 1
	if left % 2 == 0:
		for i in range(k + 1, n, 2):
			(beautiful[i], beautiful[i + 1]) = (beautiful[i + 1], beautiful[i])
	else:
		for i in range(k + 1, n - 1, 2):
			(beautiful[i], beautiful[i + 1]) = (beautiful[i + 1], beautiful[i])
		(beautiful[0], beautiful[-1]) = (beautiful[-1], beautiful[0])
	return beautiful

def print_l(l):
	string = ''
	for item in l:
		string += str(item) + ' '
	if len(string) > 1:
		string = string[0:len(string) - 1]
	print(string)

def main():
	i = input().split()
	n = int(i[0])
	k = int(i[1])
	print_l(k_beautiful(n, k))
main()


(n, k) = map(int, input().split())
if n < k + 1:
	print(-1)
else:
	s = []
	for i in range(2, n - k + 1):
		s.append(i)
	s.append(1)
	for j in range(n - k + 1, n + 1):
		s.append(j)
	print(*s)


(n, k) = map(int, input().split())
if k == n:
	print(-1)
else:
	res = n - k
	for i in range(1, res):
		print(i + 1, end=' ')
	print(1, end=' ')
	for i in range(res + 1, n + 1):
		print(i, end=' ')


(n, k) = map(int, input().split())
if k == n:
	print(-1)
else:
	ans = [i for i in range(1, k + 2)]
	for i in range(k + 2, 2 * n // 2, 2):
		ans.append(i + 1)
		ans.append(i)
	if (n + k) % 2 == 0 and k < n - 1:
		ans[0] = n
		ans.append(1)
	print(*ans)


import itertools
import math
import random
import time

def timer(f):

	def tmp(*args, **kwargs):
		t = time.time()
		res = f(*args, **kwargs)
		print('Время выполнения функции: %f' % (time.time() - t))
		return res
	return tmp

def genArray(length, lower, upper):
	return [random.randint(lower, upper) for i in range(length)]

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
(n, k) = map(int, input().split(' '))
k = n - k
if k == 0:
	print(-1)
	exit(0)
else:
	array = [0 for i in range(n)]
	for j in range(k):
		array[j] = (j - 1) % k + 1
	for j in range(k, n):
		array[j] = j + 1
ar = [i + 1 for i in range(n)]
total = 0
for i in range(n):
	if gcd(ar[i], array[i]) == 1:
		total += 1
str = array.__str__().replace('[', '').replace(']', '').replace(',', '')
print(str)


def nod(a, b):
	while a != 0 and b != 0:
		if a > b:
			a = a % b
		else:
			b = b % a
	return a + b
(n, k) = [int(i) for i in input().split()]
a = [0] * n
s = ''
if n <= k:
	print(-1)
else:
	for i in range(1, k + 1):
		a[i] = i + 1
	for i in range(k + 1, n - 1):
		a[i] = i + 2
	if n - k > 1:
		a[0] = k + 2
		a[n - 1] = 1
		a = [str(i) for i in a]
		print(' '.join(a))
	else:
		a[0] = 1
		a[n - 1] = n
		a = [str(i) for i in a]
		print(' '.join(a))


(n, k) = map(int, input().split())
if n != k:
	index = 0
	res = n * ['0']
	res[index] = str(n - k)
	index += 1
	for i in range(1, n - k):
		res[index] = str(i)
		index += 1
	for i in range(n - k + 1, n + 1):
		res[index] = str(i)
		index += 1
	print(' '.join(res))
else:
	print('-1')


t = input()
temp = t.split()
n = int(temp[0])
k = int(temp[1])
if k == n:
	print(-1)
else:
	print(n - k, end=' ')
	for i in range(1, n - k):
		print(i, end=' ')
	for i in range(n - k + 1, n + 1):
		print(i, end=' ')


import sys
(n, k) = map(int, input().split())
if k == n:
	print(-1)
	sys.exit()
elements = [i + 1 for i in range(n)]
i = 1 if (n - k) % 2 else 0
while i < n - k:
	(elements[i], elements[i + 1]) = (elements[i + 1], elements[i])
	i += 2
print(' '.join([str(e) for e in elements]))


import sys
INF = 10 ** 20
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import gcd
from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br
(n, k) = I()
if n == k:
	print(-1)
	exit()
a = [i for i in range(1, n + 1)]
for i in range(k + 1, n, 2):
	nxt = (i + 1) % n
	(a[i], a[nxt]) = (a[nxt], a[i])
print(*a)


(n, k) = input().split()
n = int(n)
k = int(k)
if n == k:
	print(-1)
else:
	for i in range(2, n - k + 1):
		print(i, end=' ')
	print(1, end=' ')
	for i in range(n - k + 1, n + 1):
		print(i, end=' ')


(n, k) = map(int, input().split())
k = n - k
if k == 0:
	print(-1)
	exit()
for i in range(n):
	if i == k - 1:
		print(1, end=' ')
	elif i > k - 1:
		print(i + 1, end=' ')
	elif i == 0:
		print(2, end=' ')
	elif i < k - 1 and i > 0:
		print(2 + i, end=' ')


(n, k) = map(int, input().split())
if n == k:
	print(-1)
else:
	(flag, count, a) = (0, 0, [])
	for i in range(1, n + 1):
		if i == 1:
			a.append(1)
		elif count < k:
			a.append(i)
			count += 1
		elif i == n:
			a.append(1)
			if flag == 0:
				a[0] = i
		elif flag == 0:
			a[0] = i
			flag = 1
			a.append(i + 1)
		else:
			a.append(i + 1)
	print(*a)


from collections import deque as de
import math
import sys
import re
from collections import Counter as cnt
from functools import reduce
from typing import MutableMapping
from itertools import groupby as gb
from fractions import Fraction as fr
from bisect import bisect_left as bl, bisect_right as br

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

class My_stack:

	def __init__(self):
		self.data = []

	def my_push(self, x):
		return self.data.append(x)

	def my_pop(self):
		return self.data.pop()

	def my_peak(self):
		return self.data[-1]

	def my_contains(self, x):
		return self.data.count(x)

	def my_show_all(self):
		return self.data

	def isEmpty(self):
		return len(self.data) == 0
arrStack = My_stack()

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def binarytodecimal(n):
	return int(n, 2)

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def get_prime_factors(number):
	prime_factors = []
	while number % 2 == 0:
		prime_factors.append(2)
		number = number / 2
	for i in range(3, int(math.sqrt(number)) + 1, 2):
		while number % i == 0:
			prime_factors.append(int(i))
			number = number / i
	if number > 2:
		prime_factors.append(int(number))
	return prime_factors

def get_frequency(list):
	dic = {}
	for ele in list:
		if ele in dic:
			dic[ele] += 1
		else:
			dic[ele] = 1
	return dic

def Log2(x):
	return math.log10(x) / math.log10(2)

def getProduct(n):
	product = 1
	while n != 0:
		product = product * (n % 10)
		n = n // 10
	return product

def dupconscount(nums):
	element = []
	freque = []
	if not nums:
		return element
	running_count = 1
	for i in range(len(nums) - 1):
		if nums[i] == nums[i + 1]:
			running_count += 1
		else:
			freque.append(running_count)
			element.append(nums[i])
			running_count = 1
	freque.append(running_count)
	element.append(nums[i + 1])
	return (element, freque)

def isPowerOfTwo(n):
	return math.ceil(Log2(n)) == math.floor(Log2(n))

def ceildiv(x, y):
	return (x + y - 1) // y

def di():
	return map(int, input().split())

def ii():
	return int(input())

def li():
	return list(map(int, input().split()))

def si():
	return list(map(int, input()))

def indic():
	dic = {}
	for (index, value) in enumerate(input().split()):
		dic[int(value)] = int(index) + 1
	return dic
(n, k) = di()
if k == n:
	print(-1)
elif n == 2:
	if k == 0:
		print(2, 1)
	else:
		print(1, 2)
else:
	ans = [i for i in range(n, n - k, -1)]
	ans.append(1)
	for i in range(n - k, 1, -1):
		ans.append(i)
	ans.reverse()
	print(*ans)


(n, k) = map(int, input().split())
z = []
for i in range(1, n + 1):
	z.append(i)
m = n - k
if n == k:
	print(-1)
	exit()
if m % 2 != 0:
	for i in range(1, m - 1, 2):
		(z[i], z[i + 1]) = (z[i + 1], z[i])
else:
	for i in range(0, m - 1, 2):
		(z[i], z[i + 1]) = (z[i + 1], z[i])
print(*z)


(n, k) = map(int, input().split())
array = [0] + [i + 1 for i in range(n)]
if n == k:
	print(-1)
else:
	for i in range(0, n - k - 1):
		(array[1], array[n - i]) = (array[n - i], array[1])
	print(*array[1:])


(n, k) = list(map(int, input().split()))
if n == k:
	print(-1)
elif n - k == 1:
	for i in range(1, n + 1):
		print(i, end=' ')
else:
	s = [0] * (n + 1)
	j = 1
	for i in range(2, k + 2):
		s[i] = i
	j = k + 3
	bachi = k + 2
	for i in range(k + 2, n):
		s[i] = j
		if j > n:
			break
		j += 1
		if j > n:
			break
	s.pop(0)
	s[-1] = 1
	s[0] = bachi
	print(*s)


import math
L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
I = lambda : int(input())
(n, k) = M()
if k >= n:
	print(-1)
	exit()
a = [1]
x = 0
for i in range(2, n + 1):
	if x == k:
		a.append(i + 1)
	else:
		a.append(i)
		x += 1
b = set(a)
for i in range(1, n + 1):
	if i not in b:
		a[0] = i
		a[-1] = 1
		break
print(*a)


ab = list(map(int, input().split()))
a = ab[0]
b = ab[1]
c = a - b
saida = ''
if a == b:
	print(-1)
else:
	saida += str(c) + ' '
	i = 1
	while i < c:
		saida += str(i) + ' '
		i += 1
	for j in range(c + 1, a + 1):
		saida += str(j) + ' '
print(saida.strip())


def mi():
	return map(int, input().split())
(n, k) = mi()
if k == n - 1:
	print(*list(range(1, n + 1)))
elif k < n:
	a = [n] + list(range(2, k + 2)) + [1] + list(range(k + 2, n))
	print(*a)
else:
	print(-1)


def gcd(a, b):
	while a != 0 and b != 0:
		if a > b:
			a = a % b
		else:
			b = b % a
	return (a + b) // 2
(n, k) = [int(i) for i in input().split()]
if n <= k:
	print('-1')
else:
	a = [i + 1 for i in range(n)]
	for i in range(n - k - 1, 0, -1):
		a[i] = a[i - 1]
	a[0] = n - k
	print(*a)


(n, k) = map(int, input().split())
if k > n - 1:
	print('-1')
	exit(0)
a = [0] * (n + 1)
for i in range(1, n + 1):
	a[i] = i
for i in range(n - k, 1, -1):
	a[i] = a[i - 1]
a[1] = n - k
for i in range(1, n + 1):
	if i > 1:
		print(' ', end='')
	print(a[i], end='')
print('')


import sys
inf = float('inf')
(mod, MOD) = (1000000007, 998244353)

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
(n, k) = get_ints()
if n == k:
	print(-1)
elif k == 0:
	print(n, *range(1, n))
else:
	print(n - k, *range(1, n - k), *range(n - k + 1, n + 1))


from sys import stdin, stdout
(n, k) = map(int, stdin.readline().strip().split())
if n == k:
	print(-1)
else:
	result = [0] * n
	for i in range(n - k, n):
		result[i] = i + 1
	for i in range(1, n - k):
		result[i] = i
	result[0] = n - k
	print(*result, sep=' ')


entrada = input().split()
n = int(entrada[0])
k = int(entrada[1])
x = 1
if (n - k) % 2 == 0:
	x = 0
aux = []
for i in range(1, n + 1):
	aux.append(i)
for j in range(x, n - k, 2):
	(aux[j], aux[j + 1]) = (aux[j + 1], aux[j])
if n != k:
	print(*aux)
else:
	print('-1')


import sys
(n, k) = map(int, input().split())
a = []
if n == k:
	print('-1')
	sys.exit()
for i in range(n):
	a.append(i + 1)
for j in range(n - k - 1):
	(a[j], a[j + 1]) = (a[j + 1], a[j])
print(*a)


from sys import stdin, stdout
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque
from heapq import merge, heapify, heappop, heappush, nsmallest
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def inp():
	return stdin.readline().strip()

def iinp():
	return int(inp())

def out(var, end='\n'):
	stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	stdout.write(' '.join(map(str, var)) + end)

def lmp():
	return list(mp())

def mp():
	return map(int, inp().split())

def smp():
	return map(str, inp().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(m, val) for j in range(n)]

def remadd(x, y):
	return 1 if x % y else 0

def ceil(a, b):
	return (a + b - 1) // b

def isprime(x):
	if x <= 1:
		return False
	if x in (2, 3):
		return True
	if x % 2 == 0:
		return False
	for i in range(3, int(sqrt(x)) + 1, 2):
		if x % i == 0:
			return False
	return True
(n, k) = lmp()
if n == k:
	print(-1)
elif k == n - 1:
	print(*[i + 1 for i in range(n)])
else:
	print(k + 2, end=' ')
	for i in range(k):
		print(i + 2, end=' ')
	for i in range(k + 2, n + 1):
		print(i % n + 1, end=' ')
	print()


(n, k) = map(int, input().split())
if k < n:
	ans = [1]
	count = 0
	for i in range(2, n + 1):
		if count == k:
			ans.append(i + 1)
		else:
			ans.append(i)
			count += 1
	hare = set(ans)
	for i in range(1, n + 1):
		if i not in hare:
			ans[0] = i
			ans[-1] = 1
			break
	print(*ans)
else:
	print(-1)


(n, k) = map(int, input().split())
if n > 2:
	if k == n:
		print('-1')
	elif k < n - 1:
		p = [n]
		for i in range(2, k + 2):
			p.append(i)
		p.append(1)
		for i in range(k + 2, n):
			p.append(i)
		print(*p)
	elif k == n - 1:
		p = []
		for i in range(1, n + 1):
			p.append(i)
		print(*p)
elif n == 2:
	if k == 1:
		print('1 2')
	elif k == 0:
		print('2 1')
	else:
		print('-1')
elif k == 0:
	print('1')
else:
	print('-1')


def perestanovka(n, k):
	if n == k:
		return [-1]
	a = [n - k]
	for i in range(1, n - k):
		a.append(i)
	for i in range(n - k + 1, n + 1):
		a.append(i)
	return a
(N, K) = [int(x) for x in input().split()]
print(*perestanovka(N, K))


(n, k) = map(int, input().split())
if k == n:
	print(-1)
else:
	print(*[n - k] + list(range(1, n - k)) + list(range(n - k + 1, n + 1)))


(n, k) = map(int, input().split())
if n == k:
	print(-1)
elif n - 1 == k:
	for i in range(n):
		print(i + 1, end=' ')
else:
	seq = [n]
	for i in range(k):
		seq.append(i + 2)
	seq.append(1)
	for i in range(n - k - 2):
		seq.append(i + k + 2)
	for i in seq:
		print(i, end=' ')


(n, p) = map(int, input().split())
if n == p:
	print(-1)
else:
	if p + 2 > n:
		print(1, end=' ')
	else:
		print(p + 2, end=' ')
	for i in range(1, p + 1):
		print(i + 1, end=' ')
	if p + 1 < n:
		for i in range(p + 1, n - 1):
			print(i + 2, end=' ')
		print(1, end=' ')


(n, k) = map(int, input().split())
if n == k:
	print(-1)
else:
	num = n - k
	ans = str(num)
	for i in range(1, num):
		ans += ' ' + str(i)
	for j in range(num + 1, n + 1):
		ans += ' ' + str(j)
	print(ans)


def main():
	(n, k) = map(int, input().split())
	L = [i for i in range(1, n + 1)]
	perms = n - k
	i = 0
	while perms > 1 and (perms > 0 and i < n - 1):
		(L[i], L[i + 1]) = (L[i + 1], L[i])
		perms -= 1
		i += 1
	if n == k:
		print(-1)
	else:
		print(*L)
main()


[n, k] = list(map(int, input().split(' ')))
if k == 0:
	print(n, end=' ')
	for i in range(1, n):
		print(i, end=' ')
	print('')
elif k == n - 1:
	for i in range(1, n + 1):
		print(i, end=' ')
	print('')
elif k < n - 1:
	beauts = 0
	numI = 2
	nums = []
	nums.append(n)
	for i in range(1, n - 1):
		if beauts < k:
			nums.append(numI)
			beauts += 1
			if beauts == k:
				nums.append(1)
		else:
			nums.append(numI)
		numI += 1
	for e in nums:
		print(e, end=' ')
	print('')
else:
	print(-1)


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
mod = int(1000000000.0) + 7
(n, k) = rinput()
if n == k:
	print(-1)
else:
	bar = n - k
	correct = list(range(n - k + 1, n + 1))
	incorrect = [n - k] + list(range(1, n - k))
	ans = incorrect + correct
	print(*ans)


(n, k) = [int(x) for x in input().split()]
k = n - k
if k == 0:
	print(-1)
else:
	print(k, end=' ')
	for i in range(1, k):
		print(i, end=' ')
	for i in range(k + 1, n + 1):
		print(i, end=' ')


def main():
	from itertools import chain
	(n, k) = map(int, input().split())
	print(' '.join(map(str, chain(range(2, n - k + 1), (1,), range(n - k + 1, n + 1)))) if k < n else -1)
main()


(n, k) = map(int, input().split())
if k >= n:
	print(-1)
elif k + 1 == n:
	print(' '.join(map(str, range(1, n + 1))))
else:
	print(' '.join(map(str, [k + 2] + list(range(2, k + 2)) + list(range(k + 3, n + 1)) + [1])))


(n, k) = map(int, input().split())
L = [0] * n
if k == n:
	print(-1)
else:
	if (n - (k + 1)) % 2 == 0:
		L[0] = 1
		for i in range(k):
			L[i + 1] = i + 2
		for i in range(k + 1, n, 2):
			L[i] = i + 2
			L[i + 1] = i + 1
	else:
		L[0] = k + 2
		for i in range(k):
			L[i + 1] = i + 2
		for i in range(k + 2, n, 2):
			L[i] = i + 2
			L[i + 1] = i + 1
		L[k + 1] = 1
	print(L[0], end='')
	for i in range(1, n):
		print(' ' + str(L[i]), end='')


(a, b) = map(int, input().split())
l = []
t = a - b - 1
if a == b:
	print(-1)
else:
	l.append(a - b)
	for i in range(t):
		l.append(i + 1)
	for j in range(t + 2, a + 1):
		l.append(j)
	print(*l)


import sys
import bisect
import heapq
from math import *
from collections import defaultdict as dd
from collections import deque
from collections import Counter as c
from itertools import combinations as comb
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(var)

def l():
	return list(map(int, data().split()))

def sl():
	return list(map(str, data().split()))

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [[val for i in range(n)] for j in range(m)]
(n, k) = sp()
answer = [i for i in range(1, n + 1)]
if k == n:
	out('-1')
	exit()
start = n - k - 1
for i in range(start, 0, -1):
	(answer[i], answer[i - 1]) = (answer[i - 1], answer[i])
print(*answer)


import sys
import math

def gcd(a, b):
	c = max(a, b)
	d = min(a, b)
	r = c % d
	if r == 0:
		return d
	return gcd(d, r)

def lcm(a, b):

	def gcd_naive(a, b):
		c = max(a, b)
		d = min(a, b)
		r = c % d
		if r == 0:
			return d
		return gcd_naive(d, r)
	return int(a * b / gcd_naive(a, b))

def fn(n, k):
	l = [0] * n
	if n <= k:
		print(-1)
		return 0
	elif n == k + 1:
		for i in range(n):
			l[i] = i + 1
		print(*l)
		return 0
	else:
		for i in range(1, k + 1):
			l[i] = i + 1
		l[0] = n
		for i in range(n - 2, k, -1):
			l[i + 1] = i + 1
		l[k + 1] = 1
		print(*l)
input = sys.stdin.read()
data = list(map(int, input.split()))
n = data[0]
k = data[1]
fn(n, k)


import sys
import math
import itertools
import collections

def getdict(n):
	d = {}
	if type(n) is list or type(n) is str:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ' '.join(map(str, arr))

def revn(n):
	return int(str(n)[::-1])

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True
(n, k) = mi()
if n == k:
	print(-1)
else:
	ans = [i for i in range(1, n + 1)]
	for i in range(n - k):
		ans[i] = i + 2
	ans[n - k - 1] = 1
	print(wr(ans))


(n, k) = map(int, input().split())
if n == k:
	print(-1)
else:
	li = []
	co = 0
	ind = 0
	for j in range(n, -1, -1):
		if co == k:
			ind = j
			break
		else:
			li.append(j)
			co += 1
	for j in range(ind, -1, -1):
		if j == 1:
			break
		else:
			li.append(j - 1)
	li.append(n - k)
	li = li[::-1]
	print(*li)


import os, sys
from io import BytesIO, IOBase
from types import GeneratorType
from bisect import *
from collections import defaultdict, deque, Counter
import math, string
from heapq import *
from operator import add
from itertools import accumulate
BUFSIZE = 8192
sys.setrecursionlimit(10 ** 5)

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
inf = float('inf')
en = lambda x: list(enumerate(x))
ceil_ = lambda a, b: (a + b - 1) // b
ii = lambda : int(input())
r = lambda : map(int, input().split())
rr = lambda : list(r())
(n, k) = r()
i = 0
arr = list(range(2, n - k + 1)) + [1] + list(range(n - k + 1, n + 1))
print(*(arr if len(arr) == len(set(arr)) else [-1]))


(n, k) = map(int, input().split())
a = list(range(1, n + 1))
x = n - k
if x & 1 == 0:
	(a[0], a[-1]) = (n, 1)
	x -= 2
else:
	x -= 1
for i in range(1, n - 1, 2):
	if x < 1:
		break
	(a[i], a[i + 1]) = (a[i + 1], a[i])
	x -= 2
if x != 0:
	print(-1)
else:
	print(' '.join(map(str, a)))


(n, k) = list(map(int, input().split()))
if n == k:
	print(-1)
elif k > n - 1:
	print(-1)
elif k == n - 1:
	for i in range(1, n + 1):
		print(i, end=' ')
elif k == 0:
	for i in range(1, n + 1):
		if i == n:
			print(1, end=' ')
		else:
			print(i + 1, end=' ')
else:
	co = 0
	for i in range(1, n + 1):
		if i == 1:
			print(k + 2, end=' ')
		elif co >= k:
			if i == n:
				print(1)
			elif i + 1 == n:
				print(n, end=' ')
			else:
				print(i + 1, end=' ')
		else:
			print(i, end=' ')
			co += 1
	print()


(n, k) = list(map(int, input().split()))
s = ''
s += str(n - k) + ' '
if n == k:
	print(-1)
else:
	for i in range(1, n - k):
		s += str(i) + ' '
	for i in range(n - k, n):
		s += str(i + 1) + ' '
	print(s.rstrip())


__author__ = 'asmn'
(n, k) = tuple(map(int, input().split()))
print(-1 if n == k else ' '.join(map(str, list(range(2, n - k + 1)) + [1] + list(range(n - k + 1, n + 1)))))


(n, k) = [int(item) for item in input().split()]
result = [0] * n
if k < n - 1:
	result[0] = n
else:
	result[n - 1] = n
l = 1
for i in range(1, n - 1):
	if i <= k:
		result[i] = i + 1
	else:
		result[-l] = n - l
		l += 1
if result.__contains__(0):
	result[result.index(0)] = 1
if n == 1 == k or k == n:
	print('-1')
else:
	print(' '.join(map(str, result)))


from __future__ import division, print_function
import itertools
import sys
import os
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	input = raw_input
	range = xrange
	filter = itertools.ifilter
	map = itertools.imap
	zip = itertools.izip

def is_it_local():
	script_dir = str(os.getcwd()).split('/')
	username = 'dipta007'
	return username in script_dir

def READ(fileName):
	if is_it_local():
		sys.stdin = open(f'./{fileName}', 'r')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
if not is_it_local():
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	input = lambda : sys.stdin.readline().rstrip('\r\n')

def input1(type=int):
	return type(input())

def input2(type=int):
	[a, b] = list(map(type, input().split()))
	return (a, b)

def input3(type=int):
	[a, b, c] = list(map(type, input().split()))
	return (a, b, c)

def input_array(type=int):
	return list(map(type, input().split()))

def input_string():
	s = input()
	return list(s)
if is_it_local():

	def debug(*args):
		st = ''
		for arg in args:
			st += f'{arg} '
		print(st)
else:

	def debug(*args):
		pass

def main():
	(n, k) = input2()
	if n - k <= 0:
		print(-1)
		exit()
	rem = n - k
	arr = [i for i in range(n + 1)]
	even = 2
	odd = 3
	if rem % 2 == 0:
		even = 2
		odd = 1
	te = even
	for i in range(odd, rem + 1, 2):
		arr[i] = te
		te += 2
	to = odd
	for i in range(even, rem + 1, 2):
		arr[i] = to
		to += 2
	print(' '.join([str(arr[i]) for i in range(1, n + 1)]))
	pass
main()


def printt(L):
	n = len(L)
	for i in range(n):
		print(L[i], end=' ')
(n, k) = map(int, input().split())
if k >= n:
	print('-1')
elif n % 2 == k % 2:
	L = []
	p = (n - k) // 2
	for i in range(1, p + 1):
		L.append(2 * i)
		L.append(2 * i - 1)
	for i in range(n - k + 1, n + 1):
		L.append(i)
	printt(L)
else:
	L = [1]
	p = (n - k - 1) // 2
	for i in range(1, p + 1):
		L.append(2 * i + 1)
		L.append(2 * i)
	for i in range(n - k + 1, n + 1):
		L.append(i)
	printt(L)


(n, k) = map(int, input().split())
ans = []
if n < k + 1:
	print(-1)
	exit()
for i in range(2, n - k + 1):
	ans.append(i)
ans.append(1)
[ans.append(i) for i in range(n - k + 1, n + 1)]
print(*ans)


(n, k) = map(int, input().split())
if n == k:
	print(-1)
else:
	arr = [i for i in range(1, n + 1)]
	var = n - k
	arr.remove(var)
	arr.insert(0, var)
	print(*arr)


def checkKey(dict, key):
	if key in dict:
		return True
	return False
(n, k) = map(int, input().split())
if k <= n - 1:
	l = [1]
	for i in range(1, n + 1):
		l.append(i)
	index = n - k
	while index - 1 >= 1:
		(l[index], l[index - 1]) = (l[index - 1], l[index])
		index = index - 1
	for i in range(1, n + 1):
		print(l[i], end=' ')
	print()
else:
	print(-1)


(num1, num2) = map(int, input().split())
permutacoes_bonitas = ''
if num1 == num2:
	print(-1)
else:
	permutacoes_bonitas += str(num1 - num2) + ' '
	for i in range(1, num1 - num2):
		permutacoes_bonitas += str(i) + ' '
	for i in range(num1 - num2 + 1, num1 + 1):
		permutacoes_bonitas += str(i) + ' '
	print(permutacoes_bonitas)


3

def readln():
	return tuple(map(int, input().split()))
(n, k) = readln()
if n == k:
	print(-1)
else:
	print(*list(range(2, n - k + 1)) + [1] + list(range(n - k + 1, n + 1)))


def wtf(i, k, n):
	if i >= n - k:
		return i
	elif (n - k) % 2 == 0:
		if i % 2 == 0:
			return i + 1
		elif i == 1:
			return 1
		else:
			return i - 1
	elif i % 2 == 0:
		return i - 1
	else:
		return i + 1

def main():
	(n, k) = list(map(int, input().split()))
	if n == k:
		print(-1)
	else:
		permutation = [str(wtf(i, k, n + 1)) for i in range(1, n + 1)]
		print(' '.join(permutation))

def __starting_point():
	main()
__starting_point()


(n, k) = map(int, input().split())
r = list(range(n))
index = 1
if k >= 0 and k < n:
	while k < n - 1:
		if k + 2 <= n - 1:
			r[index] = index + 1
			r[index + 1] = index
			index = index + 2
			k = k + 2
		elif k + 1 == n - 1:
			r[index] = 0
			r[0] = index
			k = k + 1
			break
		else:
			break
	for i in r:
		print(i + 1, end=' ')
else:
	print(-1)


import math
(n, k) = map(int, input().strip().split(' '))
l = [0] * n
if k == n:
	print(-1)
elif k == n - 1:
	for j in range(n):
		print(j + 1, end=' ')
	print()
else:
	for j in range(1, k + 1):
		l[j] = j + 1
	for j in range(k + 2, n):
		l[j] = j
	l[k + 1] = 1
	l[0] = n
	for j in range(n):
		print(l[j], end=' ')
	print()


(n, k) = list(map(int, input().split()))
if n == k:
	print(-1)
	exit()
A = [1]
good_elements_needed = k
bad_elements_needed = n - k - 1
i = 2
while good_elements_needed > 0:
	A.append(i)
	i += 1
	good_elements_needed -= 1
i = len(A) + 1
while bad_elements_needed > 0:
	A.append(i)
	(A[-1], A[0]) = (A[0], A[-1])
	i += 1
	bad_elements_needed -= 1
print(' '.join(list(map(str, A))))


def permutacaoBonita(num, numBonitos):
	permutacao = list(range(num + 1))
	numNaoBonitos = num - numBonitos
	if numNaoBonitos == 0:
		return [0, -1]
	if numNaoBonitos == 1:
		return permutacao
	i = 0
	if numNaoBonitos % 2 == 0:
		i = 1
	else:
		i = 2
	while i <= numNaoBonitos:
		permutacao[i] = i + 1
		permutacao[i + 1] = i
		i += 2
	return permutacao
entrada = input().split()
num = int(entrada[0])
numBonitos = int(entrada[1])
permutacao = permutacaoBonita(num, numBonitos)
permutacao.remove(0)
print(*permutacao)


(n, m) = map(int, input().split())
if n == m:
	print(-1)
else:
	l = [x for x in range(1, n + 1)]
	if m != 0:
		print(*l[1:-m] + [l[0]] + l[-m:])
	else:
		print(*l[1:] + [l[0]])


nums = input().split(' ')
n = int(nums[0])
k = int(nums[1])
permutations = []
permutations.append(n - k)
for val in range(1, n + 1):
	if val != permutations[0]:
		permutations.append(val)
if len(permutations) != n:
	print(-1)
else:
	for num in permutations:
		print(num, end=' ')


(n, k) = [int(x) for x in input().split()]
cont = 0
resp = [0] * n
resp[0] = n - k
for i in range(1, n - k):
	resp[i] = i
for i in range(n - k, n):
	if resp[i] == 0:
		resp[i] = i + 1
		cont += 1
if cont == 0 and k > 0 or n == k:
	print(-1)
else:
	for e in resp:
		print(e, end=' ')


(n, k) = list(map(int, input().split()))
ans = [i + 1 for i in range(n)]
if n == k:
	print(-1)
else:
	for i in range((n - k) % 2, n - k, 2):
		ans[i] = i + 2
		ans[i + 1] = i + 1
	print(*ans)


from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict
from bisect import bisect_left
mod = 1000000007

def L():
	return list(map(int, stdin.readline().split()))

def In():
	return map(int, stdin.readline().split())

def I():
	return int(stdin.readline())

def printIn(ob):
	return stdout.write(str(ob) + '\n')

def powerLL(n, p):
	result = 1
	while p:
		if p & 1:
			result = result * n % mod
		p = int(p / 2)
		n = n * n % mod
	return result
import sys

def myCode():
	(n, k) = In()
	k = n - k
	if k == 0:
		print(-1)
	else:
		print(k, end=' ')
		for i in range(1, k):
			print(i, end=' ')
		for i in range(k + 1, n + 1):
			print(i, end=' ')

def main():
	myCode()
main()


(n, k) = [int(_) for _ in input().split()]
if n == k:
	print(-1)
else:
	if (n - k) % 2 == 0:
		for _ in range(0, n - k, 2):
			print(_ + 2, _ + 1, end=' ')
	else:
		print(1, end=' ')
		for _ in range(1, n - k, 2):
			print(_ + 2, _ + 1, end=' ')
	for _ in range(n - k, n):
		print(_ + 1, end=' ')


nk = input().split()
n = int(nk[0])
k = int(nk[1])
sequence = []
if n - k == 0:
	print(-1)
	exit()
for i in range(n):
	sequence.append(str(i + 1))
if (n - k) % 2 == 0:
	for i in range(0, n - k, 2):
		(sequence[i], sequence[i + 1]) = (sequence[i + 1], sequence[i])
else:
	for i in range(1, n - k, 2):
		(sequence[i], sequence[i + 1]) = (sequence[i + 1], sequence[i])
print(' '.join(sequence))


v = map(int, input().split())
(n, k) = v
r2 = []
if k > n or (n == 1 and k > 0):
	print(-1)
elif k == n:
	print(-1)
else:
	r2.append(n - k)
	for d in range(1, n - k):
		r2.append(d)
	for e in range(n - k + 1, n + 1):
		r2.append(e)
	for v in r2:
		print(v, end=' ')


(n, k) = map(int, input().split())
if n <= k:
	print(-1)
else:
	l = [n - k]
	for i in range(2, n - k + 1):
		l.append(i - 1)
	for i in range(n - k + 1, n + 1):
		l.append(i)
	print(*l)


(n, k) = map(int, input().split(' '))
if k >= n:
	print('-1')
elif n - 1 == k:
	for i in range(1, n + 1):
		print(i, end=' ')
else:
	a = [k + 2] + list(range(2, k + 2)) + list(range(k + 3, n + 1)) + [1]
	print(*a)


(n, k) = map(int, input().split())
if k == n:
	print(-1)
elif k == n - 1:
	print(*range(1, n + 1))
else:
	ans = [0] * n
	for i in range(k):
		ans[i + 1] = i + 2
	for i in range(k, n - 1):
		ans[i + 1] = i + 3
	ans[-1] = 1
	ans[0] = k + 2
	print(*ans)


inp = input().split()
n = int(inp[0])
k = int(inp[1])
if n == 0:
	print(-1)
	exit(0)
if n == k:
	print(-1)
	exit(0)
if n == k + 1:
	for i in range(1, n + 1):
		print(i, end=' ')
	exit(0)
cnt = 0
print(n, end=' ')
cnt += 1
for i in range(2, k + 2):
	print(i, end=' ')
	cnt += 1
if cnt < n:
	print(1, end=' ')
	cnt += 1
for i in range(k + 2, n):
	print(i, end=' ')


(tamanho, n_bonitos) = map(int, input().split(' '))
n_permuta = tamanho - n_bonitos
minha_permuta = []
ponteiro_de_troca = 1
if n_bonitos < tamanho:
	for i in range(tamanho):
		minha_permuta.append(i + 1)
	if n_permuta % 2 != 0:
		ponteiro_de_troca = 2
		n_permuta -= 1
	while n_permuta > 0:
		(minha_permuta[ponteiro_de_troca], minha_permuta[ponteiro_de_troca - 1]) = (minha_permuta[ponteiro_de_troca - 1], minha_permuta[ponteiro_de_troca])
		ponteiro_de_troca += 2
		n_permuta -= 2
	print(' '.join(map(str, minha_permuta)))
else:
	print(-1)


(n, k) = list(map(int, input().split()))
p = [str(i) for i in range(1, n + 1)]
if n - k == 0:
	print(-1)
elif (n - k) % 2 == 0:
	i = 0
	while i < n - k:
		aux = p[i]
		p[i] = p[i + 1]
		p[i + 1] = aux
		i += 2
	print(' '.join(p))
else:
	i = 1
	while i < n - k:
		aux = p[i]
		p[i] = p[i + 1]
		p[i + 1] = aux
		i += 2
	print(' '.join(p))


R = lambda : map(int, input().split())
(n, k) = R()
k = n - k
if k == 0:
	print(-1)
	exit(0)
if n == k:
	s = list(map(str, range(1, n + 1)))
	print(s[-1] + ' ' + ' '.join(s[:-1]))
else:
	s = ''
	b1 = k // 2
	b2 = k % 2
	b3 = b1 if b2 == 1 else b1 - 1
	b = 0
	while b < n:
		if b == 0:
			if b2 == 1:
				s += '1 2 '
			else:
				s += '2 1 '
			b += 2
		elif b < 2 * b3 + 2:
			s += str(b + 2) + ' ' + str(b + 1) + ' '
			b += 2
		else:
			s += str(b + 1) + ' '
			b += 1
	print(s)


(n, k) = [int(x) for x in input().split()]
if k >= n:
	print(-1)
else:
	ans = []
	for i in range(n - k - 1):
		ans.append(i + 2)
	ans.append(1)
	for i in range(k):
		ans.append(n - k + 1 + i)
	print(*ans)


(x, y) = list(map(int, input().split()))
result = []
resultado = ''
saida = ''
if x == y:
	print(-1)
	exit()
result.append(x - y)
i = 1
while i < x - y:
	result.append(i)
	i += 1
for num in range(x - y + 1, x + 1):
	result.append(num)
for i in range(len(result)):
	resultado += str(result[i]) + ' '
print(resultado)


(n, k) = map(int, input().split())
if n == k:
	print(-1)
else:
	a = []
	a.append(n - k)
	for i in range(1, n - k):
		a.append(i)
	for j in range(n - k + 1, n + 1):
		a.append(j)
	print(*a)


from math import gcd
(n, k) = map(int, input().split())
ans = [0] * n
if k > n - 1:
	print(-1)
	exit()
for i in range(2, k + 2):
	ans[i - 1] = i
rem = [1]
for i in range(k + 2, n + 1):
	rem.append(i)
j = 0
for i in range(k + 2, n + 2):
	ans[i % n - 1] = rem[j]
	j += 1
count = 0
for i in range(n):
	if gcd(i + 1, ans[i]) > 1:
		count += 1
if count != k:
	print(-1)
	exit()
print(*ans)


vals = [int(x) for x in input().split()]
n = vals[0]
k = vals[1]
permutation = [1]
for i in range(1, n):
	if i < k + 1:
		permutation.append(i + 1)
	else:
		num = 0
		if k % 2 == 0:
			num = i + 2 if i % 2 != 0 else i
		else:
			num = i + 2 if i % 2 == 0 else i
		if num > n:
			num = 1
			permutation[0] = i + 1
		permutation.append(num)
if k == n:
	print(-1)
else:
	print(' '.join([str(x) for x in permutation]))


(n, k) = map(int, input().split())
if n < k + 1:
	print(-1)
else:
	print(*range(2, n - k + 1), 1, *range(n - k + 1, n + 1))


(a, b) = map(int, input().split())
if b != a:
	l = [i for i in range(2, a - b + 1)] + [1] + [i for i in range(a - b + 1, a + 1)]
	print(*l)
else:
	print(-1)


import sys
input = sys.stdin.readline
(n, k) = list(map(int, input().split()))
if k == n:
	print(-1)
	exit()
ans = list(range(n - k + 1, n + 1))
new_n = n - k
for i in range(1, new_n + 1):
	print(i % new_n + 1, end=' ')
print(*ans)


from sys import exit
(n, k) = map(int, input().split())
if n - k == 0:
	print('-1')
	exit(0)
arr = [n - k] + [i for i in range(1, n - k)] + [i for i in range(n - k + 1, n + 1)]
print(*arr, sep=' ')


(n, k) = map(int, input().split())
if n == k:
	print(-1)
elif k:
	shift = n - k
	print(n - k, end=' ')
	for _ in range(shift - 1):
		print(_ + 1, end=' ')
	for _ in range(shift + 1, n + 1):
		print(_, end=' ')
else:
	print(n)
	for _ in range(1, n):
		print(_, end=' ')


int_inp = lambda : int(input())
strng = lambda : input().strip()
strl = lambda : list(input().strip())
mul = lambda : map(int, input().split())
mulf = lambda : map(float, input().split())
seq = lambda : list(map(int, input().split()))
import math
from collections import Counter, defaultdict
(a, b) = mul()
if b == a:
	print(-1)
else:
	if a - b == 1:
		print(1, end=' ')
	for i in range(2, a + 1):
		print(i, end=' ')
		if i == a - b:
			print(1, end=' ')


(n, k) = map(int, input().split())
if k == n:
	print(-1)
else:
	bar = n - k
	print(' '.join(map(str, [bar] + list(range(1, bar)) + list(range(bar + 1, n + 1)))))


def f(l):
	(n, k) = l
	return [-1] if k >= n else [n - k] + list(range(1, n - k)) + list(range(n - k + 1, n + 1))
l = list(map(int, input().split()))
print(*f(l))


(n, k) = map(int, input().split())
if n == k:
	print('-1')
else:
	print(n - k, end=' ')
	r = 0
	r = r + 1
	j = 1
	while r < n:
		if j == n - k:
			j = j + 1
			print(j, end=' ')
			j = j + 1
		else:
			print(j, end=' ')
			j = j + 1
		r = r + 1


(n, k) = map(int, input().split(' '))
res = [i for i in range(1, n + 1)]
if n == 1 and k == 0:
	print(1)
elif n == 1 and k != 0:
	print(-1)
elif n == k:
	print(-1)
elif k == 0:
	for i in range(n - 1):
		(res[i], res[i + 1]) = (res[i + 1], res[i])
	print(*res)
else:
	val = res[len(res) - k:]
	for i in range(len(res) - k - 1):
		(res[i], res[i + 1]) = (res[i + 1], res[i])
	print(*res)


(n, k) = list(map(int, input().rstrip().split()))
if n == k:
	print(-1)
else:
	arr = []
	arr += [n - k]
	for i in range(1, n - k):
		arr += [i]
	for i in range(n - k, n):
		arr += [i + 1]
	for x in arr:
		print(x, end=' ')


import math
import sys

def left(d):
	(h, *b) = d
	return b + [h]
(n, m) = map(int, input().split())
if m > n - 1:
	print(-1)
elif m == n - 1:
	print(' '.join((str(i) for i in range(1, n + 1))))
else:
	(*body, tail) = range(1, n + 1)
	d = [tail] + left(body[:m + 1]) + body[m + 1:]
	print(' '.join((str(i) for i in d)))


import math
import sys

def solve(r, w):
	data = [int(v) for v in r.readline().split()]
	n = data[0]
	k = data[1]
	if n == k:
		print(-1)
	else:
		ans = [i for i in range(n + 1)]
		for i in range(n - k, 1, -1):
			ans[i] = ans[i - 1]
		ans[1] = n - k
		del ans[0]
		for elem in ans:
			print(elem, end=' ')
solve(sys.stdin, sys.stdout)


import math

def main():
	(n, k) = map(int, input().split())
	if n == k or n == k - 1:
		print('-1')
		exit()
	if n == k + 1:
		for i in range(n):
			print(i + 1, end=' ')
		exit()
	if n == k + 2:
		print(n, end=' ')
		for i in range(n - 2):
			print(i + 2, end=' ')
		print(1)
		exit()
	l = []
	for i in range(k + 1):
		l.append(i + 1)
	for i in range(k + 1, n - 1):
		l.append(i + 2)
	if math.gcd(10000, k + 2) > 1:
		l.append(1)
		l[0] = k + 2
	else:
		l.append(k + 2)
	print(*l)
main()


from sys import stdin, stdout
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
(n, k) = iia()
if n == 1 and k != 0 or n == k:
	print(-1)
else:
	arr = [1] * n
	i = 1
	while i < n:
		if k > 0:
			arr[i] = i + 1
			i += 1
			k -= 1
		elif i + 1 < n:
			arr[i] = i + 2
			arr[i + 1] = i + 1
			i += 2
		else:
			arr[i] = 1
			arr[0] = i + 1
			i += 1
	print(*arr)


(n, k) = map(int, input().split())
if k > n - 1:
	print(-1)
else:
	a = n - k
	ans = [n - k]
	c = 1
	d = 2
	for i in range(1, n - k):
		if (i + 1) % 2:
			ans.append(d)
			d += 2
		else:
			ans.append(c)
			c += 2
	for i in range(n - k, n):
		ans.append(i + 1)
	print(*ans)


class CodeforcesTask361BSolution:

	def __init__(self):
		self.result = ''
		self.n_k = []

	def read_input(self):
		self.n_k = [int(x) for x in input().split(' ')]

	def process_task(self):
		if self.n_k[0] == self.n_k[1]:
			self.result = '-1'
		else:
			res = [0] * self.n_k[0]
			for x in range(self.n_k[0] - self.n_k[1], self.n_k[0]):
				res[x] = x + 1
			res[0] = self.n_k[0] - self.n_k[1]
			for x in range(1, self.n_k[0] - self.n_k[1]):
				res[x] = x
			self.result = ' '.join([str(x) for x in res])

	def get_result(self):
		return self.result
Solution = CodeforcesTask361BSolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


(n, k) = [int(x) for x in input().split()]
if k == n:
	print(-1)
elif n == 1 and k == 0:
	print(1)
else:
	storti = n - k
	for i in range(2, n - k + 1):
		print(i, end=' ')
	print(1, end=' ')
	for i in range(n - k + 1, n + 1):
		print(i, end=' ')


(n, k) = map(int, input().split())
list2 = [0] * n
for i in range(n):
	list2[i] = i + 1
if n % 2 == 0:
	if k < n:
		k = n - k
		if k % 2 == 0:
			for i in range(0, n, 2):
				if k > 0:
					k -= 2
					(list2[i], list2[i + 1]) = (list2[i + 1], list2[i])
				else:
					break
		else:
			k -= 1
			for i in range(1, n, 2):
				if k > 0:
					k -= 2
					(list2[i], list2[i + 1]) = (list2[i + 1], list2[i])
				else:
					break
		print(*list2)
	else:
		print(-1)
elif k < n:
	k = n - k
	if k % 2 == 0:
		for i in range(0, n, 2):
			if k > 0:
				k -= 2
				(list2[i], list2[i + 1]) = (list2[i + 1], list2[i])
			else:
				break
	else:
		k -= 1
		for i in range(1, n, 2):
			if k > 0:
				k -= 2
				(list2[i], list2[i + 1]) = (list2[i + 1], list2[i])
			else:
				break
	print(*list2)
else:
	print(-1)


import math as mt
import sys, string, bisect
input = sys.stdin.readline
from collections import deque
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
(a, b) = M()
if b >= a:
	print(-1)
else:
	l = [a]
	if a == 1:
		print(*l)
	else:
		i = 0
		for i in range(2, 2 + b):
			l.append(i)
		if i >= a:
			l[0] = 1
		else:
			l.append(1)
		for i in range(2 + b, a):
			l.append(i)
		print(*l)


(n, k) = [int(x) for x in input().split()]
if n == k:
	print(-1)
else:
	list1 = [0] * (n + 1)
	list1[1] = 1
	i = 2
	temp = k
	while temp > 0:
		list1[i] = i
		i += 1
		temp -= 1
	if n % 2 == 0 and k % 2 == 0 or (n % 2 != 0 and k % 2 != 0):
		for i in range(k + 2, n + 1, 2):
			(list1[i], list1[(i + 1) % n]) = ((i + 1) % n, i)
	else:
		for i in range(k + 2, n + 1, 2):
			(list1[i], list1[i + 1]) = (i + 1, i)
	print(*list1[1:])


import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from itertools import accumulate, combinations, combinations_with_replacement, groupby, permutations, product
from math import acos, asin, atan, ceil, cos, degrees, factorial, gcd, hypot, log2, pi, radians, sin, sqrt, tan
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

def inp():
	return int(input())

def inlist():
	return list(map(int, input().split()))

def instr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
(n, k) = invr()
a = []
if k > n - 1:
	print(-1)
elif k == n - 1:
	for i in range(1, n + 1):
		print(i, end=' ')
else:
	a.append(k + 2)
	for i in range(2, k + 2):
		a.append(i)
	for i in range(k + 3, n + 1):
		a.append(i)
	a.append(1)
	print(*a)


(n, k) = input().split()
n = int(n)
k = int(k)
a = []
b = 1
for i in range(n):
	a.append(b)
	b += 1
c = n - k
if c % 2 == 0:
	for j in range(0, c, 2):
		(a[j], a[j + 1]) = (a[j + 1], a[j])
else:
	for j in range(1, c, 2):
		(a[j], a[j + 1]) = (a[j + 1], a[j])
if n != k:
	print(*a)
else:
	print(-1)


import fractions
(n, k) = list(map(int, input().split()))
A = [i + 1 for i in range(n)]
if k == n:
	print(-1)
else:
	good = n - 1
	i = n - 1
	while good - k > 1:
		(A[i], A[i - 1]) = (A[i - 1], A[i])
		good -= 2
		i -= 2
	if good - k == 1:
		for i in range(1, n):
			if fractions.gcd(i + 1, A[i]) != 1:
				(A[i], A[0]) = (A[0], A[i])
				good -= 1
				break
	if good == k:
		print(' '.join(map(str, A)))
	else:
		print(-1)