# your code goes here
size, call_no = map(int, input().split())

list_val = [i for i in range(1,size+1)]

#print(list_val)

if call_no == 1:
	str_val = " ".join(str(x) for x in list_val)
	print(str_val)

def modify(list_val,l,r):
	global count

	if count == call_no or r-l<2:
		return
	mid = (l+r)//2
	temp = list_val[mid]
	list_val[mid] = list_val[mid-1]
	list_val[mid-1] = temp
	count+=2
	modify(list_val,l,mid)
	modify(list_val,mid,r)

if call_no%2 == 0:
	print("-1")

else:
    count = 1
    modify(list_val,0,len(list_val)-1)
    if count < call_no:
        print("-1")
    else:
        print(" ".join(str(x) for x in list_val))


# your code goes here
size, call_no = map(int, input().split())

list_val = [i for i in range(1,size+1)]

#print(list_val)

def modify(list_val,l,r):
	global count

	if count == call_no or r-l<2:
		return
	mid = (l+r)//2
	temp = list_val[mid]
	list_val[mid] = list_val[mid-1]
	list_val[mid-1] = temp
	count+=2
	modify(list_val,l,mid-1)
	modify(list_val,mid,r)

if call_no == 1:
	str_val = " ".join(str(x) for x in list_val)
	print(str_val)

elif call_no%2 == 0:
	print("-1")

else:
    count = 1
    modify(list_val,0,len(list_val)-1)
    if count < call_no:
        print("-1")
    else:
        print(" ".join(str(x) for x in list_val))


# your code goes here
size, call_no = map(int, input().split())

list_val = [i for i in range(1,size+1)]

#print(list_val)

def modify(list_val,l,r):
	global count

	if count == call_no or r-l<2:
		return
	mid = (l+r)//2
	temp = list_val[mid]
	list_val[mid] = list_val[mid-1]
	list_val[mid-1] = temp
	count+=2
	modify(list_val,l,mid)
	modify(list_val,mid+1,r)

if call_no == 1:
	str_val = " ".join(str(x) for x in list_val)
	print(str_val)

elif call_no%2 == 0:
	print("-1")

else:
    count = 1
    modify(list_val,0,len(list_val)-1)
    if count < call_no:
        print("-1")
    else:
        print(" ".join(str(x) for x in list_val))


# your code goes here
size, call_no = map(int, input().split())

list_val = [i for i in range(1,size+1)]

#print(list_val)

def modify(list_val,l,r):
	global count

	if count == call_no or r-l<2:
		return
	mid = (l+r)//2
	temp = list_val[mid]
	list_val[mid] = list_val[mid-1]
	list_val[mid-1] = temp
	count+=2
	modify(list_val,l,mid)
	modify(list_val,mid,r)

if call_no == 1:
	str_val = " ".join(str(x) for x in list_val)
	print(str_val)

elif call_no%2 == 0:
	print("-1")

else:
    count = 1
    modify(list_val,0,len(list_val)-1)
    if count < call_no:
        print("-1")
    else:
        print(" ".join(str(x) for x in list_val))


using System;
using System.IO;
using System.Text;

namespace Merge_Sort
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static int[] nn;

        private static void Main(string[] args)
        {
            Solve(args);
            writer.Flush();
        }

        private static void Solve(string[] args)
        {
            int n = Next();
            int k = Next();

            nn = new int[n];
            for (int i = 0; i < n; i++)
            {
                nn[i] = i + 1;
            }
            if (k > 0)
            {
                k--;
                Mergesort(0, n, ref k);
            }

            if (k == 0)
            {
                foreach (int i in nn)
                {
                    writer.Write(i);
                    writer.Write(' ');
                }
            }
            else
            {
                writer.WriteLine("-1");
            }
        }

        private static void Mergesort(int l, int r, ref int k)
        {
            if (k > 1 && r > l + 1)
            {
                int m = (l + r)/2;
                k -= 2;
                int t = nn[m-1];
                nn[m-1] = nn[m];
                nn[m] = t;

                Mergesort(l, m, ref k);
                Mergesort(m, r, ref k);
            }
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}


#if DEBUG
using System.Reflection;
using System.Threading.Tasks;
#endif

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
using System.Globalization;

namespace ed30d
{
    class Program
    {
        static string _inputFilename = "input.txt";
        static string _outputFilename = "output.txt";
        static bool _useFileInput = false;

        static void Main(string[] args)
        {
            StreamWriter file = null;
#if DEBUG
			Console.SetIn(getInput());
#else
            if (_useFileInput)
            {
                Console.SetIn(File.OpenText(_inputFilename));
                file = new StreamWriter(_outputFilename);
                Console.SetOut(file);
            }
#endif

            try
            {
                solution();
            }
            finally
            {
                if (_useFileInput)
                {
                    file.Close();
                }
            }
        }

        static void solution()
        {
            #region SOLUTION
            var d = readIntArray();
            var n = d[0];
            var k = d[1];

            if (k == 0)
            {
                Console.WriteLine(-1);
                return;
            }
            var a = Enumerable.Range(1, n).ToArray();
            var rem = k - 1;
            var result = merge(a, 0, n - 1, rem);

            if (result == 0)
            {
                for (int i = 0; i < n; i++)
                {
                    Console.Write("{0} ", a[i]);
                }
            }
            else
            {
                Console.WriteLine(-1);
            }
            //var n = readInt();
            //var m = readInt();

            //var a = readIntArray();
            //var b = readIntArray();
            #endregion
        }

        static int merge(int[] a, int l, int r, int rem)
        {
            if (rem <= 0)
            {
                return rem;
            }

            if (l == r)
            {
                return rem;
            }

            var mid = l + (r - l - 1) / 2;

            var temp = a[mid];
            a[mid] = a[mid + 1];
            a[mid + 1] = temp;

            rem -= 2;

            //if (l < mid)
            //{
            //    rem--;
            //}
            //if (mid < r)
            //{
            //    rem--;
            //}

            if (rem <= 0)
            {
                return rem;
            }

            var left = merge(a, l, mid, rem);
            if (left <= 0)
            {
                return left;
            }

            var right = merge(a, mid + 1, r, left);

            return right;
        }

        static int readInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long readLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int[] readIntArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();
        }

        static long[] readLongArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();
        }

#if DEBUG
		static StreamReader getInput()
		{
			var resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];
			var resource = Assembly.GetCallingAssembly().GetManifestResourceStream(resName);

			return new StreamReader(resource);
		}
#endif
    }
}


@file:Suppress("NOTHING_TO_INLINE", "EXPERIMENTAL_FEATURE_WARNING", "OVERRIDE_BY_INLINE")

import java.io.PrintWriter
import java.util.StringTokenizer
import kotlin.math.*
import kotlin.random.*
import kotlin.system.exitProcess
import kotlin.collections.sort as _sort
import kotlin.collections.sortDescending as _sortDescending
import kotlin.io.println as iprintln

/** @author Spheniscine */
fun main() { _writer.solve(); _writer.flush() }
fun PrintWriter.solve() {
    val n = readInt()
    var k = readInt()

    var i = n
    val ans = IntArray(n)

    fun mergeGen(l: Int, r: Int) {
        if(l+1 == r) {
            ans[l] = i--
        } else when(k) {
            0 -> {
                for(j in r-1 downTo l) ans[j] = i--
            }
            1 -> fail()
            else -> {
                val mid = (l + r) / 2
                k -= 2
                mergeGen(l, mid)
                mergeGen(mid, r)
            }
        }
    }

    k--
    mergeGen(0, n)
    if(k != 0) fail()
    println(ans.joinToString(" "))
}

fun fail(): Nothing {
    iprintln(-1)
    exitProcess(0)
}

/** IO code start */
//@JvmField val INPUT = File("input.txt").inputStream()
//@JvmField val OUTPUT = File("output.txt").outputStream()
@JvmField val INPUT = System.`in`
@JvmField val OUTPUT = System.out

@JvmField val _reader = INPUT.bufferedReader()
fun readLine(): String? = _reader.readLine()
fun readLn() = _reader.readLine()!!
@JvmField var _tokenizer: StringTokenizer = StringTokenizer("")
fun read(): String {
    while (_tokenizer.hasMoreTokens().not()) _tokenizer = StringTokenizer(_reader.readLine() ?: return "", " ")
    return _tokenizer.nextToken()
}
fun readInt() = read().toInt()
fun readDouble() = read().toDouble()
fun readLong() = read().toLong()
fun readStrings(n: Int) = List(n) { read() }
fun readLines(n: Int) = List(n) { readLn() }
fun readInts(n: Int) = List(n) { read().toInt() }
fun readIntArray(n: Int) = IntArray(n) { read().toInt() }
fun readDoubles(n: Int) = List(n) { read().toDouble() }
fun readDoubleArray(n: Int) = DoubleArray(n) { read().toDouble() }
fun readLongs(n: Int) = List(n) { read().toLong() }
fun readLongArray(n: Int) = LongArray(n) { read().toLong() }

@JvmField val _writer = PrintWriter(OUTPUT, false)

/** shuffles and sort overrides to avoid quicksort attacks */
private inline fun <T> _shuffle(rnd: Random, get: (Int) -> T, set: (Int, T) -> Unit, size: Int) {
    // Fisher-Yates shuffle algorithm
    for (i in size - 1 downTo 1) {
        val j = rnd.nextInt(i + 1)
        val temp = get(i)
        set(i, get(j))
        set(j, temp)
    }
}

@JvmField var _random: Random? = null
val random get() = _random ?: Random(0x594E215C123 * System.nanoTime()).also { _random = it }

fun IntArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
fun IntArray.sort() { shuffle(); _sort() }
fun IntArray.sortDescending() { shuffle(); _sortDescending() }

fun LongArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
fun LongArray.sort() { shuffle(); _sort() }
fun LongArray.sortDescending() { shuffle(); _sortDescending() }

fun DoubleArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
fun DoubleArray.sort() { shuffle(); _sort() }
fun DoubleArray.sortDescending() { shuffle(); _sortDescending() }

fun CharArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
inline fun CharArray.sort() { _sort() }
inline fun CharArray.sortDescending() { _sortDescending() }

inline fun <T: Comparable<T>> Array<out T>.sort() = _sort()
inline fun <T: Comparable<T>> Array<out T>.sortDescending() = _sortDescending()
inline fun <T: Comparable<T>> MutableList<out T>.sort() = _sort()
inline fun <T: Comparable<T>> MutableList<out T>.sortDescending() = _sortDescending()

fun `please stop removing these imports IntelliJ`() {
    iprintln(max(1, 2))
}


@file:Suppress("NOTHING_TO_INLINE", "EXPERIMENTAL_FEATURE_WARNING", "OVERRIDE_BY_INLINE")

import java.io.PrintWriter
import java.util.StringTokenizer
import kotlin.math.*
import kotlin.random.*
import kotlin.system.exitProcess
import kotlin.collections.sort as _sort
import kotlin.collections.sortDescending as _sortDescending
import kotlin.io.println as iprintln

/** @author Spheniscine */
fun main() { _writer.solve(); _writer.flush() }
fun PrintWriter.solve() {
    val n = readInt()
    var k = readInt()

    var i = n
    val ans = IntArray(n)

    fun mergeGen(l: Int, r: Int) {
        k--
        if(l+1 == r) {
            ans[l] = i--
        } else when(k) {
            0 -> {
                for(j in r-1 downTo l) ans[j] = i--
            }
            1 -> fail()
            else -> {
                val mid = (l + r) / 2
                mergeGen(l, mid)
                mergeGen(mid, r)
            }
        }
    }

    mergeGen(0, n)
    if(k != 0) fail()
    println(ans.joinToString(" "))
}

fun fail(): Nothing {
    iprintln(-1)
    exitProcess(0)
}

/** IO code start */
//@JvmField val INPUT = File("input.txt").inputStream()
//@JvmField val OUTPUT = File("output.txt").outputStream()
@JvmField val INPUT = System.`in`
@JvmField val OUTPUT = System.out

@JvmField val _reader = INPUT.bufferedReader()
fun readLine(): String? = _reader.readLine()
fun readLn() = _reader.readLine()!!
@JvmField var _tokenizer: StringTokenizer = StringTokenizer("")
fun read(): String {
    while (_tokenizer.hasMoreTokens().not()) _tokenizer = StringTokenizer(_reader.readLine() ?: return "", " ")
    return _tokenizer.nextToken()
}
fun readInt() = read().toInt()
fun readDouble() = read().toDouble()
fun readLong() = read().toLong()
fun readStrings(n: Int) = List(n) { read() }
fun readLines(n: Int) = List(n) { readLn() }
fun readInts(n: Int) = List(n) { read().toInt() }
fun readIntArray(n: Int) = IntArray(n) { read().toInt() }
fun readDoubles(n: Int) = List(n) { read().toDouble() }
fun readDoubleArray(n: Int) = DoubleArray(n) { read().toDouble() }
fun readLongs(n: Int) = List(n) { read().toLong() }
fun readLongArray(n: Int) = LongArray(n) { read().toLong() }

@JvmField val _writer = PrintWriter(OUTPUT, false)

/** shuffles and sort overrides to avoid quicksort attacks */
private inline fun <T> _shuffle(rnd: Random, get: (Int) -> T, set: (Int, T) -> Unit, size: Int) {
    // Fisher-Yates shuffle algorithm
    for (i in size - 1 downTo 1) {
        val j = rnd.nextInt(i + 1)
        val temp = get(i)
        set(i, get(j))
        set(j, temp)
    }
}

@JvmField var _random: Random? = null
val random get() = _random ?: Random(0x594E215C123 * System.nanoTime()).also { _random = it }

fun IntArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
fun IntArray.sort() { shuffle(); _sort() }
fun IntArray.sortDescending() { shuffle(); _sortDescending() }

fun LongArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
fun LongArray.sort() { shuffle(); _sort() }
fun LongArray.sortDescending() { shuffle(); _sortDescending() }

fun DoubleArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
fun DoubleArray.sort() { shuffle(); _sort() }
fun DoubleArray.sortDescending() { shuffle(); _sortDescending() }

fun CharArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
inline fun CharArray.sort() { _sort() }
inline fun CharArray.sortDescending() { _sortDescending() }

inline fun <T: Comparable<T>> Array<out T>.sort() = _sort()
inline fun <T: Comparable<T>> Array<out T>.sortDescending() = _sortDescending()
inline fun <T: Comparable<T>> MutableList<out T>.sort() = _sort()
inline fun <T: Comparable<T>> MutableList<out T>.sortDescending() = _sortDescending()

fun `please stop removing these imports IntelliJ`() {
    iprintln(max(1, 2))
}


#include <stdio.h>
#define MAXN    100003

int n, k;
int a[MAXN];

void dfs(int l, int r, int nl, int nr)
{
    if (l == r - 1) {
        a[l] = nl;
    } else if (k == 0) {
        for (; l < r; ++l, ++nl) a[l] = nl;
    } else {
        --k;
        int m = (l + r) / 2;
        dfs(l, m, nr - (m - l), nr);
        dfs(m, r, nl, nr - (m - l));
    }
}

int main()
{
    scanf("%d%d", &n, &k);
    if (k % 2 == 0 || k >= n * 2) {
        puts("-1"); return 0;
    }

    k /= 2;
    dfs(0, n, 1, n + 1);
    int i;
    for (i = 0; i < n; ++i) printf("%d%c", a[i], i == n - 1 ? '\n' : ' ');

    return 0;
}


#include<stdio.h>
#include<limits.h>
#define MAX 100005
int a[MAX] ,num = 1;
int L[MAX] ,R[MAX] ,ok = 0;
void merge(int i ,int q,int j){
	int l;
	for(l = i; l <= q ;l++)	L[l - i] = a[l];	L[l - i] = INT_MAX;
	for(l = q + 1 ; l <= j ; l++)	R[l - q - 1] = a[l];	R[l - q - 1]	= INT_MAX;
	int k ,m = 0 ,s = 0;
	for(k = i ; R[s] != INT_MAX ; k++ ,s++)	a[k] = R[s];
	while(k <= j)
		a[k++] = L[m++];

}
void merge_sort(int i ,int j ,int s ,int k) {
    if(i > j)   return;
    if(i == j){
        a[i] = num++;
        return;
    }
	if(s < k){
		int q = (i + j) / 2;
		merge_sort(i ,q ,s + 2 ,k);
		merge_sort(q + 1 ,j ,s + 2 ,k);
		merge(i ,q ,j);
	}else{
	    ok = 1;
		int l;
		for(l = i ; l <= j ; l++){
			a[l] = num++;
		}
	}
}
int main(){
	int n ,k ,i;
	scanf("%d%d" ,&n ,&k);
	if(k & 1) {
		if(k == 1)
			for(i = 0 ; i < n ; i++)	printf("%d " ,i + 1);
		else{
			merge_sort(0 ,n - 1 ,1 ,k);
			if(ok)
	        		for(i = 0 ; i < n ; i++)	printf("%d " ,a[i]);
			else printf("-1");
		}
	}else printf("-1");
}


#include<stdio.h>
#include<limits.h>
#define MAX 100005
int a[MAX] ,num = 1;
int L[MAX] ,R[MAX] ,ok = 0;
void merge(int i ,int q,int j){
	int l;
	for(l = i; l <= q ;l++)	L[l - i] = a[l];	L[l - i] = INT_MAX;
	for(l = q + 1 ; l <= j ; l++)	R[l - q - 1] = a[l];	R[l - q - 1]	= INT_MAX;
	int k ,m = 0 ,s = 0;
	for(k = i ; R[s] != INT_MAX ; k++ ,s++)	a[k] = R[s];
	while(k <= j)
		a[k++] = L[m++];

}
void merge_sort(int i ,int j ,int s ,int k) {
    if(i > j)   return;
    if(i == j){
        a[i] = num++;
        return;
    }
	if(s < k){
		int q = (i + j) / 2;
		merge_sort(i ,q ,s + 2 ,k);
		merge_sort(q + 1 ,j ,s + 2 ,k);
		merge(i ,q ,j);
	}else{
	    ok = 1;
		int l;
		for(l = i ; l <= j ; l++){
			a[l] = num++;
		}
	}
}
int main(){
	int n ,k ,i;
	scanf("%d%d" ,&n ,&k);
	if(k & 1) {
		if(k == 1)
			for(i = 0 ; i < n ; i++)	a[i] = i + 1;
		else
			merge_sort(0 ,n - 1 ,1 ,k);
			if(ok)
	        	for(i = 0 ; i < n ; i++)	printf("%d " ,a[i]);
	        else printf("-1");
	}else printf("-1");
}


#include<stdio.h>
#include<limits.h>
#define MAX 100005
int a[MAX] ,num = 1 ,ok = 0;
int L[MAX] ,R[MAX] ;
void merge(int i ,int q,int j){
	int l;
	for(l = i; l <= q ;l++)	L[l - i] = a[l];	L[l - i] = INT_MAX;
	for(l = q + 1 ; l <= j ; l++)	R[l - q - 1] = a[l];	R[l - q - 1]	= INT_MAX;
	int k ,m = 0 ,s = 0;
	for(k = i ; R[s] != INT_MAX ; k++ ,s++)	a[k] = R[s];
	while(k <= j)
		a[k++] = L[m++];

}
void merge_sort(int i ,int j ,int s ,int k) {
    if(i > j)   return;
    if(i == j){
	//if(s >= k)	ok = 1;
        a[i] = num++;
        return;
    }
	if(s < k){
		int q = (i + j) / 2;
		merge_sort(i ,q ,s + 2 ,k);
		merge_sort(q + 1 ,j ,s + 2 ,k);
		merge(i ,q ,j);
	}else{

		int l;
		for(l = i ; l <= j ; l++){
			a[l] = num++;
		}
	}
}
int main(){
	int n ,k ,i;
	scanf("%d%d" ,&n ,&k);
	if(k & 1) {
		if(k == 1)
			for(i = 0 ; i < n ; i++)	printf("%d " ,i + 1);
		else{
			merge_sort(0 ,n - 1 ,1 ,k);
			//if(ok)
	        		for(i = 0 ; i < n ; i++)	printf("%d " ,a[i]);
			//else printf("-1");
		}
	}else printf("-1");
}


#include<stdio.h>
#include<limits.h>
#define MAX 100005
int a[MAX] ,k ,p;
void f(int l ,int r){
	if(k <= 0 || l == r - 1){
		int i;
		for(i = l; i < r ;i++)	a[i] = ++p;
		return;
	}
	if(k >= 2){
		k -= 2;
		int m = (l + r)/2;
		f(m ,r);
		f(l ,m);
	}
}
int main(){
	int n ,i;
	scanf("%d%d" ,&n ,&k);
	k--;
	f(0 ,n)	;
	if(k == 0){
		for(i = 0 ; i < n ; i++)	printf("%d " ,a[i]);
	}else printf("-1");
}


#include<stdio.h>
#include<limits.h>
#define MAX 100005
int a[MAX] ,k ,p;
void f(int l ,int r){
	if(k <= 0 || l == r - 1){
		int i;
		for(i = l; i < r ;i++)	a[i] = ++p;
		return;
	}
	if(k >= 2){
		k -= 2;
		int m = (l + r)/2;
		f(l ,m);
		f(m ,r);
	}
}
int main(){
	int n ,i;
	scanf("%d%d" ,&n ,&k);
	k--;
	f(0 ,n)	;
	if(k == 0){
		for(i = 0 ; i < n ; i++)	printf("%d " ,a[i]);
	}else printf("-1");
}


#include<stdio.h>
#include<limits.h>
#define MAX 100005
int a[MAX] ,ok = 0 ,num = 1 ,diff,dd ,L[MAX] ,R[MAX];
void merge(int l ,int q,int r){
	int i ,j;
	for(i = l ; i <= q ; i++)	L[i - l] = a[i];	L[i - l] = INT_MAX;
	for(i = q + 1 ; i <= r; i++)	R[i - q - 1] = a[i];	R[i - q - 1] = INT_MAX;
	i = l ,j = 0;
	while(R[j] != INT_MAX)	a[i] = R[j++] ,i++;
	j = 0;
	while(L[j] != INT_MAX)	a[i] = L[j++] ,i++;
}
void merge_sort(int l,int r ,int h , int total) {
	if(l > r)	return;
	if(h == total){
		if(ok){
			if(dd < diff){
				dd += 2;
				int q = (l + r) / 2 ,i;
				for(i = q + 1; i<= r;i++)	a[i] = num++;
				for(i = l ; i <= q ; i++)	a[i] = num++;
				return;
			}
		}
		int i;
		for(i = l ; i <= r; i++)	a[i] = num++;
		return;
	}
	int q = (l + r) / 2;
	merge_sort(l ,q ,h + 1 ,total);
	merge_sort(q + 1 ,r,h + 1 ,total);
	merge(l , q ,r);

}

int main(){
	int n ,k ,i;
	scanf("%d%d" ,&n ,&k);
	if(k & 1) {
		if(k == 1)
			for(i = 0 ; i < n ; i++)	printf("%d " ,i + 1);
		else{
			int nn = n ,kk = k ,t = 0 ,r = 0;
			if(k > 2 * n - 1)	printf("-1");
			else{
				if((k + 1) & (k) == 0){
					r = 0 ,kk = k + 1;
					while(kk > 1)	kk /= 2 ,r++;
					merge_sort(0 ,n-1 ,0 ,r - 1);
				}else{
					ok = 1;
					r = 0 ,kk = 1;
					while(kk < k)	kk *= 2 , r++;
					r-- ,kk /= 2;
					diff = k - kk ,dd = 0;
					merge_sort(0 ,n - 1 ,0 ,r - 1);
				}
				for(i = 0 ; i < n ; i++)	printf("%d " ,a[i]);
			}
		}
	}else printf("-1");
}


#include<stdio.h>
#include<limits.h>
#define MAX 100005
int a[MAX] ,ok = 0 ,num = 1 ,diff,dd ,L[MAX] ,R[MAX];
void merge(int l ,int q,int r){
	int i ,j;
	for(i = l ; i <= q ; i++)	L[i - l] = a[i];	L[i - l] = INT_MAX;
	for(i = q + 1 ; i <= r; i++)	R[i - q - 1] = a[i];	R[i - q - 1] = INT_MAX;
	i = l ,j = 0;
	while(R[j] != INT_MAX)	a[i] = R[j++] ,i++;
	j = 0;
	while(L[j] != INT_MAX)	a[i] = L[j++] ,i++;
}
void merge_sort(int l,int r ,int h , int total) {
	if(l > r)	return;
	if(h == total){
		if(ok){
			if(dd < diff){
				dd += 2;
				int q = (l + r) / 2 ,i;
				for(i = q + 1; i<= r;i++)	a[i] = num++;
				for(i = l ; i <= q ; i++)	a[i] = num++;
				return;
			}
		}
		int i;
		for(i = l ; i <= r; i++)	a[i] = num++;
		return;
	}
	int q = (l + r) / 2;
	merge_sort(l ,q ,h + 1 ,total);
	merge_sort(q + 1 ,r,h + 1 ,total);
	merge(l , q ,r);

}

int main(){
	int n ,k ,i;
	scanf("%d%d" ,&n ,&k);
	if(k & 1) {
		if(k == 1)
			for(i = 0 ; i < n ; i++)	printf("%d " ,i + 1);
		else{
			int nn = n ,kk = k ,t = 0 ,r = 0;
			if(k > 2 * n - 1)	printf("-1");
			else{
				if((k + 1) & (k) == 0){
					r = 0 ,kk = k + 1;
					while(kk > 1)	kk /= 2 ,r++;
					merge_sort(0 ,n-1 ,0 ,r);
				}else{
					ok = 1;
					r = 0 ,kk = 1;
					while(kk < k)	kk *= 2 , r++;
					r-- ,kk /= 2;
					diff = k - kk ,dd = 0;
					merge_sort(0 ,n - 1 ,0 ,r);
				}
				for(i = 0 ; i < n ; i++)	printf("%d " ,a[i]);
			}
		}
	}else printf("-1");
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Collections;

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author dima
 */
public class Main {

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {

        int N;

        public void solve(int testNumber, Scanner in, PrintWriter out) {
            N = in.nextInt();
            final int K = in.nextInt();
            if ((K & 1) == 0 || getMaxCalls(N) < K) {
                out.print(-1);
            } else {
                Integer[] result = new Integer[N];
                int next = N;
                for (int i = 0; i < N; ++i, --next) {
                    result[i] = next;
                }
                solve(result, 0, N, K);
                for (int i = 0; i < N; ++i) {
                    out.print(result[i]);
                    out.print(' ');
                }
            }
        }

        int getMaxCalls(int l) {
            int log1 = 31 - Integer.numberOfLeadingZeros(l);
            int log2 = log1 + 1;
            return (1 << log2) - 1 + ((l & (1 << log1) - 1) * 2);
        }

        void solve(Integer[] a, int start, int end, int K) {
            if (K == 1) {
                setBest(a, start, end);
            } else if (K == getMaxCalls(end - start)) {
                setWorst(a, start, end);
            } else if (end - start > 1) {
                int mid = start + ((end - start) >> 1);
                int maxLeft = getMaxCalls(mid - start);
                int maxRight = getMaxCalls(end - mid);
                K -= 1;
                if (maxRight <= K - 1) {
                    setWorst(a, mid, end);
                    K -= maxRight;
                    solve(a, start, mid, K);
                } else if (maxLeft <= K - 1) {
                    setWorst(a, start, mid);
                    K -= maxLeft;
                    solve(a, mid, end, K);
                } else {
                    setBest(a, mid, end);
                    solve(a, start, mid, K - 1);
                }
            }
        }

        void setWorst(Integer[] a, int start, int end) {
            Arrays.sort(a, start, end, Collections.reverseOrder());
        }

        void setBest(Integer[] a, int start, int end) {
            Arrays.sort(a, start, end);
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author dima
 */
public class Main {

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {

        int N;

        public void solve(int testNumber, Scanner in, PrintWriter out) {
            N = in.nextInt();
            final int K = in.nextInt();
            if ((K & 1) == 0 || getMaxCalls(N) < K) {
                out.print(-1);
            } else {
                int[] result = new int[N];
                for (int i = 0; i < N; i += 2) {
                    result[i] = 1;
                }
                solve(result, 0, N, K);
                for (int i = 0; i < N; ++i) {
                    out.print(result[i]);
                    out.print(' ');
                }
            }
        }

        int getMaxCalls(int l) {
            int log1 = 31 - Integer.numberOfLeadingZeros(l);
            int log2 = log1 + 1;
            return (1 << log2) - 1 + ((l & (1 << log1) - 1) * 2);
        }

        void solve(int[] a, int start, int end, int K) {
            if (K == 1) {
                setBest(a, start, end, N);
            } else if (K == 3) {
                setWorst(a, start, end, N);
            } else if (end - start > 1) {
                int mid = start + ((end - start) >> 1);
                int maxLeft = getMaxCalls(mid - start);
                int maxRight = getMaxCalls(end - mid);
                K -= 1;
                if (maxRight <= K - 1) {
                    setWorst(a, mid, end, N);
                    K -= maxRight;
                    solve(a, start, mid, K);
                } else if (maxLeft <= K - 1) {
                    setWorst(a, start, mid, N);
                    K -= maxLeft;
                    solve(a, mid, end, K);
                } else {
                    solve(a, mid, end, 1);
                    solve(a, start, mid, K - 1);
                }
            } else {
                a[start] = start + 1;
            }
        }

        void setWorst(int[] a, int start, int end, int N) {
            int next = end;
            for (int i = start; i < end; ++i, --next) {
                a[i] = next;
            }
        }

        void setBest(int[] a, int start, int end, int N) {
            int next = start + 1;
            for (int i = start; i < end; ++i, ++next) {
                a[i] = next;
            }
        }

    }
}


// Problem : D. Merge Sort
// Contest : Codeforces - Educational Codeforces Round 30
// URL : https://codeforces.com/problemset/problem/873/D
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

import java.io.*;
import java.util.*;
import java.util.stream.*;

public class a implements Runnable{

    public static void main(String[] args) {
        new Thread(null, new a(), "process", 1<<26).start();
    }
	public void run() {
		FastReader scan = new FastReader();
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		//PrintWriter out = new PrintWriter("file.out");
		Task solver = new Task();
		//int t = scan.nextInt();
		int t = 1;
		for(int i = 1; i <= t; i++) solver.solve(i, scan, out);
		out.close();
	}

	static class Task {
		static final int inf = Integer.MAX_VALUE;

		public void solve(int testNumber, FastReader sc, PrintWriter pw) {
			//CHECK FOR QUICKSORT TLE
			//***********************//
			//CHECK FOR INT OVERFLOW
			//***********************//
			int n = sc.nextInt();
			int m = sc.nextInt();
			if(m % 2 == 0) {
				pw.println(-1);
				return;
			}
			Queue<tup> s = new LinkedList<>();
			s.add(new tup(0, n));
			int[] x = new int[n];
			for(int i = 0; i < n; i++) {
				x[i] = i + 1;
			}
			m--;
			while(!s.isEmpty() && m > 0) {
				tup t = s.poll();
				if(t.b - t.a <= 1) continue;
				m -= 2;
				int mid = (t.a + t.b) / 2;
				x[mid] ^= x[mid-1];
				x[mid-1] ^= x[mid];
				x[mid] ^= x[mid-1];
				s.add(new tup(t.a, (t.a + t.b) / 2));
				s.add(new tup((t.a + t.b) / 2, t.b));
			}
			if(m > 0) {
				pw.println(-1);
				return;
			}
			for(int c : x) {
				pw.print(c + " ");
			}
			pw.println();
		}
	}
	static long binpow(long a, long b, long m) {
		a %= m;
		long res = 1;
		while (b > 0) {
			if ((b & 1) == 1)
				res = res * a % m;
			a = a * a % m;
			b >>= 1;
		}
		return res;
	}
	static void sort(int[] x){
		shuffle(x);
		Arrays.sort(x);
	}
	static void sort(long[] x){
		shuffle(x);
		Arrays.sort(x);
	}
	static class tup implements Comparable<tup>{
		int a, b;
		tup(int a,int b){
			this.a=a;
			this.b=b;
		}
		@Override
		public int compareTo(tup o){
			return Integer.compare(o.b,b);
		}
	}
	static void shuffle(int[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(i + 1);
			int temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static void shuffle(long[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(i + 1);
			long temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		public FastReader(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

}


// Problem : D. Merge Sort
// Contest : Codeforces - Educational Codeforces Round 30
// URL : https://codeforces.com/problemset/problem/873/D
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

import java.io.*;
import java.util.*;
import java.util.stream.*;

public class a implements Runnable{

    public static void main(String[] args) {
        new Thread(null, new a(), "process", 1<<26).start();
    }
	public void run() {
		FastReader scan = new FastReader();
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		//PrintWriter out = new PrintWriter("file.out");
		Task solver = new Task();
		//int t = scan.nextInt();
		int t = 1;
		for(int i = 1; i <= t; i++) solver.solve(i, scan, out);
		out.close();
	}

	static class Task {
		static final int inf = Integer.MAX_VALUE;

		public void solve(int testNumber, FastReader sc, PrintWriter pw) {
			//CHECK FOR QUICKSORT TLE
			//***********************//
			//CHECK FOR INT OVERFLOW
			//***********************//
			int n = sc.nextInt();
			int m = sc.nextInt();
			if(m % 2 == 0) {
				pw.println(-1);
				return;
			}
			Stack<tup> s = new Stack<>();
			s.add(new tup(0, n));
			int[] x = new int[n];
			for(int i = 0; i < n; i++) {
				x[i] = i + 1;
			}
			m--;
			while(!s.isEmpty() && m > 0) {
				tup t = s.pop();
				if(t.b - t.a == 0) continue;
				m -= 2;
				int mid = (t.a + t.b) / 2;
				x[mid] ^= x[mid-1];
				x[mid-1] ^= x[mid];
				x[mid] ^= x[mid-1];
				s.push(new tup(t.a, (t.a + t.b) / 2));
				s.push(new tup((t.a + t.b) / 2, t.b));
			}
			if(m > 0) {
				pw.println(-1);
				return;
			}
			for(int c : x) {
				pw.print(c + " ");
			}
			pw.println();
		}
	}
	static long binpow(long a, long b, long m) {
		a %= m;
		long res = 1;
		while (b > 0) {
			if ((b & 1) == 1)
				res = res * a % m;
			a = a * a % m;
			b >>= 1;
		}
		return res;
	}
	static void sort(int[] x){
		shuffle(x);
		Arrays.sort(x);
	}
	static void sort(long[] x){
		shuffle(x);
		Arrays.sort(x);
	}
	static class tup implements Comparable<tup>{
		int a, b;
		tup(int a,int b){
			this.a=a;
			this.b=b;
		}
		@Override
		public int compareTo(tup o){
			return Integer.compare(o.b,b);
		}
	}
	static void shuffle(int[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(i + 1);
			int temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static void shuffle(long[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(i + 1);
			long temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		public FastReader(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        int n;
        int k;
        int[] ans;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            n = in.nextInt();
            k = in.nextInt();
            if (k % 2 == 0) {
                out.println(-1);
                return;
            }
            --k;
            ans = new int[n];
            for (int i = 0; i < n; ++i) {
                ans[i] = i;
            }
            calc(0, n);
            if (k > 0) {
                out.println(-1);
                return;
            }
            for (int i = 0; i < n; ++i) {
                out.print((ans[i] + 1) + " ");
            }
            out.println();
        }

        private void calc(int l, int r) {
            if (k == 0) return;
            if (r - l <= 1) return;
            k -= 2;
            if (r - l == 2) {
                int tmp = ans[r - 1];
                ans[r - 1] = ans[l];
                ans[l] = tmp;
                return;
            }
            int h = (l + r) / 2;
            int tmp = ans[h - 1];
            ans[h - 1] = ans[h];
            ans[h] = tmp;
            calc(l, h);
            calc(h, r);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 65536 / 2);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {
    public void solve(int arr[], int numberOfCalls) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls);
    }

    public boolean isSorted(int arr[]) {
        for(int i=1; i<arr.length; i++) {
            if(arr[i-1] > arr[i])
                return false;
        }
        return true;
    }

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge_sort(int []arr, int start, int end, int numberOfCalls) {

        if(start > end) return;
        int mid = (start + end) / 2;
        swap(arr, mid, mid-1);
        if(isSorted(arr) || numberOfCalls==0) return;
        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
        merge(arr, start, mid, end, numberOfCalls);
        numberOfCalls--;
    }

    public void merge(int [] arr, int start, int mid, int end, int numberOfCalls) {
        int n1 = mid - start + 1;
        int n2 = end - mid;

        int L[] = new int[n1];
        int R[] = new int[n2];

        for(int i=0; i<n1; i++)
            L[i] = arr[i+start];
        for(int i=0; i<n2; i++)
            R[i] = arr[i+mid+1];

        int i=0, j=0, k=start;
        while(k<=end) {
            if(j>=n2 || i<n1 && L[i] <= R[j])
                arr[k] = L[i++];
            else
                arr[k] = R[j++];
            k++;
        }
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		int N = Integer.parseInt(br.readLine());
    		int numberOfCalls = Integer.parseInt(br.readLine());

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		merge.solve(arr, numberOfCalls);
		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {
    public void solve(int arr[], int numberOfCalls) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls);
    }

    public boolean isSorted(int arr[]) {
        for(int i=1; i<arr.length; i++) {
            if(arr[i-1] > arr[i])
                return false;
        }
        return true;
    }

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge_sort(int []arr, int start, int end, int numberOfCalls) {

        if(start > end) return;
        int mid = (start + end) / 2;
        if(mid > 0)
            swap(arr, mid, mid-1);
        if(isSorted(arr) || numberOfCalls==0) return;
        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
        merge(arr, start, mid, end, numberOfCalls);
        numberOfCalls--;
    }

    public void merge(int [] arr, int start, int mid, int end, int numberOfCalls) {
        int n1 = mid - start + 1;
        int n2 = end - mid;

        int L[] = new int[n1];
        int R[] = new int[n2];

        for(int i=0; i<n1; i++)
            L[i] = arr[i+start];
        for(int i=0; i<n2; i++)
            R[i] = arr[i+mid+1];

        int i=0, j=0, k=start;
        while(k<=end) {
            if(j>=n2 || i<n1 && L[i] <= R[j])
                arr[k] = L[i++];
            else
                arr[k] = R[j++];
            k++;
        }
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		merge.solve(arr, numberOfCalls);
		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge_sort(int []arr, int start, int end,
        int numberOfCalls, int[] count) {

        if(end - start < 2 || count[0] >= numberOfCalls-1) return;
        int mid = (start + end) / 2;
        swap(arr, mid, mid-1);
        count[0] +=2;

        merge_sort(arr, start, mid, numberOfCalls, count);
        merge_sort(arr, mid, end, numberOfCalls, count);
    }

    public void solve(int arr[], int numberOfCalls, int[] count) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls, count);
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		int count[] = {1};
    		merge.solve(arr, numberOfCalls, count);
    		if (count[0] != numberOfCalls)
    		    out.print(-1);
    		else {
        		for(int i=0; i<arr.length; i++) {
        		    out.print(arr[i] + " ");
        		}
    		}
    		out.println();

		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge_sort(int []arr, int start, int end,
        int numberOfCalls, int[] count) {

        if(end - start < 2 || count[0] >= numberOfCalls) return;
        int mid = (start + end) / 2;
        swap(arr, mid, mid-1);
        count[0] +=2;

        merge_sort(arr, start, mid, numberOfCalls, count);
        merge_sort(arr, mid, end, numberOfCalls, count);
    }

    public void solve(int arr[], int numberOfCalls, int[] count) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls, count);
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		int count[] = {1};
    		merge.solve(arr, numberOfCalls, count);
    		if (count[0] != numberOfCalls)
    		    out.print(-1);
    		else {
        		for(int i=0; i<arr.length; i++) {
        		    out.print(arr[i] + " ");
        		}
    		}
    		out.println();

		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge_sort(int []arr, int start, int end,
        int k, int[] count) {

        if((count[0] >= k) || (end - start < 2)) return;
        int mid = (start + end) / 2;
        swap(arr, mid, mid-1);
        count[0] +=2;

        merge_sort(arr, start, mid, k, count);
        merge_sort(arr, mid, end, k, count);
    }

    public void solve(int arr[], int k, int[] count) {
        merge_sort(arr, 0, arr.length-1, k, count);
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int k = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		int count[] = {1};
    		merge.solve(arr, k, count);
    		if (count[0] != k)
    		    out.print(-1);
    		else {
        		for(int i=0; i<arr.length; i++) {
        		    out.print(arr[i] + " ");
        		}
    		}
    		out.println();

		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public boolean isSorted(int arr[]) {
        for(int i=1; i<arr.length; i++) {
            if(arr[i-1] > arr[i])
                return false;
        }
        return true;
    }

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge(int [] arr, int start, int mid, int end, int numberOfCalls) {
        int n1 = mid - start + 1;
        int n2 = end - mid;

        int L[] = new int[n1];
        int R[] = new int[n2];

        for(int i=0; i<n1; i++)
            L[i] = arr[i+start];
        for(int i=0; i<n2; i++)
            R[i] = arr[i+mid+1];

        int i=0, j=0, k=start;
        while(k<=end) {
            if(j>=n2 || i<n1 && L[i] <= R[j])
                arr[k] = L[i++];
            else
                arr[k] = R[j++];
            k++;
        }
    }

    public void merge_sort(int []arr, int start, int end, int numberOfCalls) {
        numberOfCalls-=2;
        if(start >= end) return;
        int mid = (start + end) / 2;
        if(mid > 0 && numberOfCalls > 0)
            swap(arr, mid, mid-1);
        if(numberOfCalls == 0 || isSorted(arr)) {
            if(numberOfCalls != 0)
                numberOfCallsNotZero = true;
            return;
        }

        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
        //merge(arr, start, mid, end, numberOfCalls);
    }

    public void solve(int arr[], int numberOfCalls) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls);
    }

    public static boolean numberOfCallsNotZero = false;
    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		if(numberOfCalls == 1) {
        		for(int i=0; i<arr.length; i++)
        		    out.print(arr[i] + " ");
        		out.println();
    		} else if(numberOfCalls % 2 == 0) {
    		        out.print(-1);
    		} else {
        		merge.solve(arr, numberOfCalls-1);
        		if(numberOfCallsNotZero) {
        		    out.print(-1);
        		} else {
            		for(int i=0; i<arr.length; i++)
            		    out.print(arr[i] + " ");
            		out.println();
        		}
    		}
		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge_sort(int []arr, int start, int end, int numberOfCalls) {

        if(end - start < 2 || numberOfCalls < 1) return;
        int mid = (start + end) / 2;
        swap(arr, mid, mid-1);
        numberOfCalls-=2;

        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
    }

    public void solve(int arr[], int numberOfCalls) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls);
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		merge.solve(arr, numberOfCalls);
    		if (numberOfCalls != 0)
    		    out.print(-1);
    		else {
        		for(int i=0; i<arr.length; i++) {
        		    out.print(arr[i] + " ");
        		}
    		}
    		out.println();

		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public boolean isSorted(int arr[]) {
        for(int i=1; i<arr.length; i++) {
            if(arr[i-1] > arr[i])
                return false;
        }
        return true;
    }

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge(int [] arr, int start, int mid, int end, int numberOfCalls) {
        int n1 = mid - start + 1;
        int n2 = end - mid;

        int L[] = new int[n1];
        int R[] = new int[n2];

        for(int i=0; i<n1; i++)
            L[i] = arr[i+start];
        for(int i=0; i<n2; i++)
            R[i] = arr[i+mid+1];

        int i=0, j=0, k=start;
        while(k<=end) {
            if(j>=n2 || i<n1 && L[i] <= R[j])
                arr[k] = L[i++];
            else
                arr[k] = R[j++];
            k++;
        }
    }

    public void merge_sort(int []arr, int start, int end, int numberOfCalls) {
        numberOfCalls-=2;
        if(start >= end) return;
        int mid = (start + end) / 2;
        if(mid > 0)
            swap(arr, mid, mid-1);
        if(numberOfCalls == 0 || isSorted(arr)) {
            if(numberOfCalls != 0)
                numberOfCallsNotZero = true;
            return;
        }

        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
        //merge(arr, start, mid, end, numberOfCalls);
    }

    public void solve(int arr[], int numberOfCalls) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls);
    }

    public static boolean numberOfCallsNotZero = false;
    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		if(numberOfCalls == 1) {
        		for(int i=0; i<arr.length; i++)
        		    out.print(arr[i] + " ");
        		out.println();
    		} else {
    		   if(numberOfCalls % 2 == 0)
    		        numberOfCalls += 1;
        		merge.solve(arr, numberOfCalls-1);
        		if(numberOfCallsNotZero) {
        		    out.print(-1);
        		} else {
            		for(int i=0; i<arr.length; i++)
            		    out.print(arr[i] + " ");
            		out.println();
        		}
    		}
		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public boolean isSorted(int arr[]) {
        for(int i=1; i<arr.length; i++) {
            if(arr[i-1] > arr[i])
                return false;
        }
        return true;
    }

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge(int [] arr, int start, int mid, int end, int numberOfCalls) {
        int n1 = mid - start + 1;
        int n2 = end - mid;

        int L[] = new int[n1];
        int R[] = new int[n2];

        for(int i=0; i<n1; i++)
            L[i] = arr[i+start];
        for(int i=0; i<n2; i++)
            R[i] = arr[i+mid+1];

        int i=0, j=0, k=start;
        while(k<=end) {
            if(j>=n2 || i<n1 && L[i] <= R[j])
                arr[k] = L[i++];
            else
                arr[k] = R[j++];
            k++;
        }
    }

    public void merge_sort(int []arr, int start, int end, int numberOfCalls) {
        numberOfCalls-=2;
        if(start >= end) return;
        int mid = (start + end) / 2;
        if(mid > 0)
            swap(arr, mid, mid-1);
        if(numberOfCalls == 0 || isSorted(arr)) {
            if(numberOfCalls != 0)
                numberOfCallsNotZero = true;
            return;
        }

        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
        merge(arr, start, mid, end, numberOfCalls);
    }

    public void solve(int arr[], int numberOfCalls) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls);
    }

    public static boolean numberOfCallsNotZero = false;
    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		merge.solve(arr, numberOfCalls-1);
    		if(numberOfCallsNotZero) {
    		    out.print(-1);
    		} else {
        		for(int i=0; i<arr.length; i++)
        		    out.print(arr[i] + " ");
        		out.println();
    		}
		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {
    public void solve(int arr[], int numberOfCalls) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls);
    }

    public boolean isSorted(int arr[]) {
        for(int i=1; i<arr.length; i++) {
            if(arr[i-1] > arr[i])
                return false;
        }
        return true;
    }

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge_sort(int []arr, int start, int end, int numberOfCalls) {

        if(start > end) return;
        int mid = (start + end) / 2;
        swap(arr, mid, mid-1);
        if(isSorted(arr) || numberOfCalls==0) return;
        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
        merge(arr, start, mid, end, numberOfCalls);
        numberOfCalls--;
    }

    public void merge(int [] arr, int start, int mid, int end, int numberOfCalls) {
        int n1 = mid - start + 1;
        int n2 = end - mid;

        int L[] = new int[n1];
        int R[] = new int[n2];

        for(int i=0; i<n1; i++)
            L[i] = arr[i+start];
        for(int i=0; i<n2; i++)
            R[i] = arr[i+mid+1];

        int i=0, j=0, k=start;
        while(k<=end) {
            if(j>=n2 || i<n1 && L[i] <= R[j])
                arr[k] = L[i++];
            else
                arr[k] = R[j++];
            k++;
        }
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		merge.solve(arr, numberOfCalls);
		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge_sort(int []arr, int start, int end,
        int numberOfCalls, int[] count) {

        if(end - start < 2 || count[0] >= numberOfCalls) return;
        int mid = (start + end) / 2;
        swap(arr, mid, mid-1);
        count[0] +=2;

        merge_sort(arr, start, mid, numberOfCalls, count);
        merge_sort(arr, mid, end, numberOfCalls, count);
    }

    public void solve(int arr[], int numberOfCalls, int[] count) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls, count);
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		int[] count = new int[1];
    		count[0] = 1;
    		merge.solve(arr, numberOfCalls, count);
    		if (count[0] != numberOfCalls)
    		    out.print(-1);
    		else {
        		for(int i=0; i<arr.length; i++) {
        		    out.print(arr[i] + " ");
        		}
    		}
    		out.println();

		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge_sort(int []arr, int start, int end,
        int numberOfCalls, int[] count) {

        if(end - start < 2 || count[0] >= numberOfCalls) return;
        int mid = (start + end) / 2;
        swap(arr, mid, mid-1);
        count[0] +=2;

        merge_sort(arr, start, mid, numberOfCalls, count);
        merge_sort(arr, mid+1, end, numberOfCalls, count);
    }

    public void solve(int arr[], int numberOfCalls, int[] count) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls, count);
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		int[] count = new int[1];
    		count[0] = 1;
    		merge.solve(arr, numberOfCalls, count);
    		if (count[0] != numberOfCalls)
    		    out.print(-1);
    		else {
        		for(int i=0; i<arr.length; i++) {
        		    out.print(arr[i] + " ");
        		}
    		}
    		out.println();

		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge_sort(int []arr, int start, int end,
        int numberOfCalls, int[] count) {

        if(count[0] >= numberOfCalls || end - start < 2) return;
        int mid = (start + end) / 2;
        swap(arr, mid, mid-1);
        count[0] +=2;

        merge_sort(arr, start, mid, numberOfCalls, count);
        merge_sort(arr, mid, end, numberOfCalls, count);
    }

    public void solve(int arr[], int numberOfCalls, int[] count) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls, count);
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		int count[] = {1};
    		merge.solve(arr, numberOfCalls, count);
    		if (count[0] != numberOfCalls)
    		    out.print(-1);
    		else {
        		for(int i=0; i<arr.length; i++) {
        		    out.print(arr[i] + " ");
        		}
    		}
    		out.println();

		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {
    public void solve(int arr[], int numberOfCalls) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls);
    }

    public boolean isSorted(int arr[]) {
        for(int i=1; i<arr.length; i++) {
            if(arr[i-1] > arr[i])
                return false;
        }
        return true;
    }

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge_sort(int []arr, int start, int end, int numberOfCalls) {
        numberOfCalls--;
        if(start >= end) return;
        int mid = (start + end) / 2;
        if(mid > 0)
            swap(arr, mid, mid-1);
        if(isSorted(arr) || numberOfCalls==0) return;
        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
        merge(arr, start, mid, end, numberOfCalls);

    }

    public void merge(int [] arr, int start, int mid, int end, int numberOfCalls) {
        int n1 = mid - start + 1;
        int n2 = end - mid;

        int L[] = new int[n1];
        int R[] = new int[n2];

        for(int i=0; i<n1; i++)
            L[i] = arr[i+start];
        for(int i=0; i<n2; i++)
            R[i] = arr[i+mid+1];

        int i=0, j=0, k=start;
        while(k<=end) {
            if(j>=n2 || i<n1 && L[i] <= R[j])
                arr[k] = L[i++];
            else
                arr[k] = R[j++];
            k++;
        }
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		merge.solve(arr, numberOfCalls);
    		for(int i=0; i<arr.length; i++)
    		    out.print(arr[i] + " ");
    		out.println();
		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge_sort(int []arr, int start, int end,
        int numberOfCalls, Integer count) {

        if(end - start < 2 || count >= numberOfCalls) return;
        int mid = (start + end) / 2;
        swap(arr, mid, mid-1);
        count +=2;

        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
    }

    public void solve(int arr[], int numberOfCalls, Integer count) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls, count);
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		Integer count = 0;
    		merge.solve(arr, numberOfCalls, count);
    		if (count != numberOfCalls)
    		    out.print(-1);
    		else {
        		for(int i=0; i<arr.length; i++) {
        		    out.print(arr[i] + " ");
        		}
    		}
    		out.println();

		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {
    public void solve(int arr[], int numberOfCalls) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls);
    }

    public boolean isSorted(int arr[]) {
        for(int i=1; i<arr.length; i++) {
            if(arr[i-1] > arr[i])
                return false;
        }
        return true;
    }

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge_sort(int []arr, int start, int end, int numberOfCalls) {

        if(start > end) return;
        int mid = (start + end) / 2;
        swap(arr, mid, mid-1);
        if(isSorted(arr) || numberOfCalls==0) return;
        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
        merge(arr, start, mid, end, numberOfCalls);
        numberOfCalls--;
    }

    public void merge(int [] arr, int start, int mid, int end, int numberOfCalls) {
        int n1 = mid - start + 1;
        int n2 = end - mid;

        int L[] = new int[n1];
        int R[] = new int[n2];

        for(int i=0; i<n1; i++)
            L[i] = arr[i+start];
        for(int i=0; i<n2; i++)
            R[i] = arr[i+mid+1];

        int i=0; j=0, k=start;
        while(k<=end) {
            if(j>=n2 || i<n1 && L[i] <= R[j])
                arr[k] = L[i++];
            else
                arr[k] = R[j++];
            k++;
        }
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		int N = Integer.parseInt(br.readLine());
    		int numberOfCalls = Integer.parseInt(br.readLine());

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new GFGMergeSort;
    		merge.solve(arr, numberOfCalls);
		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public boolean isSorted(int arr[]) {
        for(int i=1; i<arr.length; i++) {
            if(arr[i-1] > arr[i])
                return false;
        }
        return true;
    }

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge(int [] nums, int start, int mid, int end, int numberOfCalls) {
        int i = start, j = mid + 1;
        int temp[] = new int[end - start + 1];
        int k = 0;

        while(i <= mid && j <= end) {
            if(nums[i] <= nums[j]) {
                temp[k++] = nums[i++];
            } else {
                temp[k++] = nums[j++];
            }
        }

        while(i <= mid) {
            temp[k++] = nums[i++];
        }
        while(j <= end) {
            temp[k++] = nums[j++];
        }

        for(int p = 0; p < end - start + 1; p++) {
            nums[p + start] = temp[p];
        }
    }

    public void merge_sort(int []arr, int start, int end, int numberOfCalls) {

        if(start >= end) return;
        int mid = (start + end) / 2;
        if(mid > 0 && numberOfCalls > 0)
            swap(arr, mid, mid-1);
        numberOfCalls-=2;
        if(numberOfCalls == 0 || isSorted(arr)) {
            return;
        }

        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
        merge(arr, start, mid, end, numberOfCalls);
    }

    public void solve(int arr[], int numberOfCalls) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls);
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		if(numberOfCalls == 1) {
        		for(int i=0; i<arr.length; i++)
        		    out.print(arr[i] + " ");
        		out.println();
    		} else if(numberOfCalls % 2 == 0) {
    		        out.print(-1);
    		} else {
        		merge.solve(arr, numberOfCalls-1);
        		for(int i=0; i<arr.length; i++)
        		    out.print(arr[i] + " ");
        		out.println();
    		}
		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public boolean isSorted(int arr[]) {
        for(int i=1; i<arr.length; i++) {
            if(arr[i-1] > arr[i])
                return false;
        }
        return true;
    }

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge(int [] arr, int start, int mid, int end, int numberOfCalls) {
        int n1 = mid - start + 1;
        int n2 = end - mid;

        int L[] = new int[n1];
        int R[] = new int[n2];

        for(int i=0; i<n1; i++)
            L[i] = arr[i+start];
        for(int i=0; i<n2; i++)
            R[i] = arr[i+mid+1];

        int i=0, j=0, k=start;
        while(k<=end) {
            if(j>=n2 || i<n1 && L[i] <= R[j])
                arr[k] = L[i++];
            else
                arr[k] = R[j++];
            k++;
        }
    }

    public void merge_sort(int []arr, int start, int end, int numberOfCalls) {
        numberOfCalls-=2;
        if(start >= end) return;
        int mid = (start + end) / 2;
        if(mid > 0)
            swap(arr, mid, mid-1);
        if(numberOfCalls == 0 || isSorted(arr)) {
            if(numberOfCalls != 0)
                numberOfCallsNotZero = true;
            return;
        }

        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
        //merge(arr, start, mid, end, numberOfCalls);
    }

    public void solve(int arr[], int numberOfCalls) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls);
    }

    public static boolean numberOfCallsNotZero = false;
    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		merge.solve(arr, numberOfCalls-1);
    		if(numberOfCallsNotZero) {
    		    out.print(-1);
    		} else {
        		for(int i=0; i<arr.length; i++)
        		    out.print(arr[i] + " ");
        		out.println();
    		}
		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {
    public void solve(int arr[], int numberOfCalls) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls);
    }

    public boolean isSorted(int arr[]) {
        for(int i=1; i<arr.length; i++) {
            if(arr[i-1] > arr[i])
                return false;
        }
        return true;
    }

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge_sort(int []arr, int start, int end, int numberOfCalls) {

        if(start >= end) return;
        int mid = (start + end) / 2;
        if(mid > 0)
            swap(arr, mid, mid-1);
        if(isSorted(arr) || numberOfCalls==0) return;
        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
        merge(arr, start, mid, end, numberOfCalls);
        numberOfCalls--;
    }

    public void merge(int [] arr, int start, int mid, int end, int numberOfCalls) {
        int n1 = mid - start + 1;
        int n2 = end - mid;

        int L[] = new int[n1];
        int R[] = new int[n2];

        for(int i=0; i<n1; i++)
            L[i] = arr[i+start];
        for(int i=0; i<n2; i++)
            R[i] = arr[i+mid+1];

        int i=0, j=0, k=start;
        while(k<=end) {
            if(j>=n2 || i<n1 && L[i] <= R[j])
                arr[k] = L[i++];
            else
                arr[k] = R[j++];
            k++;
        }
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		merge.solve(arr, numberOfCalls);
    		for(int i=0; i<arr.length; i++)
    		    out.print(arr[i] + " ");
    		out.println();
		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public boolean isSorted(int arr[]) {
        for(int i=1; i<arr.length; i++) {
            if(arr[i-1] > arr[i])
                return false;
        }
        return true;
    }

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge(int [] nums, int start, int mid, int end, int numberOfCalls) {
        int i = start, j = mid + 1;
        int temp[] = new int[end - start + 1];
        int k = 0;

        while(i <= mid && j <= end) {
            if(nums[i] <= nums[j]) {
                temp[k++] = nums[i++];
            } else {
                temp[k++] = nums[j++];
            }
        }

        while(i <= mid) {
            temp[k++] = nums[i++];
        }
        while(j <= end) {
            temp[k++] = nums[j++];
        }

        for(int p = 0; p < end - start + 1; p++) {
            nums[p + start] = temp[p];
        }
    }

    public void merge_sort(int []arr, int start, int end, int numberOfCalls) {

        if(end - start < 2 || numberOfCalls < 1) return;
        int mid = (start + end) / 2;
        swap(arr, mid, mid-1);
        numberOfCalls-=2;

        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
    }

    public void solve(int arr[], int numberOfCalls) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls);
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		merge.solve(arr, numberOfCalls);
    		for(int i=0; i<arr.length; i++) {
        		    out.print(arr[i] + " ");
        		out.println();
    		}
		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public boolean isSorted(int arr[]) {
        for(int i=1; i<arr.length; i++) {
            if(arr[i-1] > arr[i])
                return false;
        }
        return true;
    }

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge(int [] arr, int start, int mid, int end, int numberOfCalls) {
        int n1 = mid - start + 1;
        int n2 = end - mid;

        int L[] = new int[n1];
        int R[] = new int[n2];

        for(int i=0; i<n1; i++)
            L[i] = arr[i+start];
        for(int i=0; i<n2; i++)
            R[i] = arr[i+mid+1];

        int i=0, j=0, k=start;
        while(k<=end) {
            if(j>=n2 || i<n1 && L[i] <= R[j])
                arr[k] = L[i++];
            else
                arr[k] = R[j++];
            k++;
        }
    }

    public void merge_sort(int []arr, int start, int end, int numberOfCalls) {

        if(start >= end) return;
        int mid = (start + end) / 2;
        if(mid > 0 && numberOfCalls > 0)
            swap(arr, mid, mid-1);
        numberOfCalls-=2;
        if(numberOfCalls == 0 || isSorted(arr)) {
            if(numberOfCalls != 0)
                numberOfCallsNotZero = true;
            return;
        }

        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
        //merge(arr, start, mid, end, numberOfCalls);
    }

    public void solve(int arr[], int numberOfCalls) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls);
    }

    public static boolean numberOfCallsNotZero = false;
    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		if(numberOfCalls == 1) {
        		for(int i=0; i<arr.length; i++)
        		    out.print(arr[i] + " ");
        		out.println();
    		} else if(numberOfCalls % 2 == 0) {
    		        out.print(-1);
    		} else {
        		merge.solve(arr, numberOfCalls-1);
        		if(numberOfCallsNotZero) {
        		    out.print(-1);
        		} else {
            		for(int i=0; i<arr.length; i++)
            		    out.print(arr[i] + " ");
            		out.println();
        		}
    		}
		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public boolean isSorted(int arr[]) {
        for(int i=1; i<arr.length; i++) {
            if(arr[i-1] > arr[i])
                return false;
        }
        return true;
    }

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge(int [] arr, int start, int mid, int end, int numberOfCalls) {
        int n1 = mid - start + 1;
        int n2 = end - mid;

        int L[] = new int[n1];
        int R[] = new int[n2];

        for(int i=0; i<n1; i++)
            L[i] = arr[i+start];
        for(int i=0; i<n2; i++)
            R[i] = arr[i+mid+1];

        int i=0, j=0, k=start;
        while(k<=end) {
            if(j>=n2 || i<n1 && L[i] <= R[j])
                arr[k] = L[i++];
            else
                arr[k] = R[j++];
            k++;
        }
    }

    public void merge_sort(int []arr, int start, int end, int numberOfCalls) {
        numberOfCalls-=2;
        if(start >= end) return;
        int mid = (start + end) / 2;
        if(mid > 0)
            swap(arr, mid, mid-1);
        if(numberOfCalls == 0 || isSorted(arr)) {
            numberOfCallsNotZero = true;
            return;
        }

        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
        merge(arr, start, mid, end, numberOfCalls);
    }

    public void solve(int arr[], int numberOfCalls) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls);
    }

    boolean numberOfCallsNotZero = false;
    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		merge.solve(arr, numberOfCalls-1);
    		if(numberOfCallsNotZero) {
    		    out.print(-1);
    		} else {
        		for(int i=0; i<arr.length; i++)
        		    out.print(arr[i] + " ");
        		out.println();
    		}
		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {
    public void solve(int arr[], int numberOfCalls) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls);
    }

    public boolean isSorted(int arr[]) {
        for(int i=1; i<arr.length; i++) {
            if(arr[i-1] > arr[i])
                return false;
        }
        return true;
    }

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge_sort(int []arr, int start, int end, int numberOfCalls) {
        numberOfCalls-=2;
        if(start >= end) return;
        int mid = (start + end) / 2;
        if(mid > 0)
            swap(arr, mid, mid-1);
        if(numberOfCalls==0 || isSorted(arr)) return;
        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
        merge(arr, start, mid, end, numberOfCalls);

    }

    public void merge(int [] arr, int start, int mid, int end, int numberOfCalls) {
        int n1 = mid - start + 1;
        int n2 = end - mid;

        int L[] = new int[n1];
        int R[] = new int[n2];

        for(int i=0; i<n1; i++)
            L[i] = arr[i+start];
        for(int i=0; i<n2; i++)
            R[i] = arr[i+mid+1];

        int i=0, j=0, k=start;
        while(k<=end) {
            if(j>=n2 || i<n1 && L[i] <= R[j])
                arr[k] = L[i++];
            else
                arr[k] = R[j++];
            k++;
        }
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		merge.solve(arr, numberOfCalls-1);
    		for(int i=0; i<arr.length; i++)
    		    out.print(arr[i] + " ");
    		out.println();
		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public boolean isSorted(int arr[]) {
        for(int i=1; i<arr.length; i++) {
            if(arr[i-1] > arr[i])
                return false;
        }
        return true;
    }

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge(int [] arr, int start, int mid, int end, int numberOfCalls) {
        int n1 = mid - start + 1;
        int n2 = end - mid;

        int L[] = new int[n1];
        int R[] = new int[n2];

        for(int i=0; i<n1; i++)
            L[i] = arr[i+start];
        for(int i=0; i<n2; i++)
            R[i] = arr[i+mid+1];

        int i=0, j=0, k=start;
        while(k<=end) {
            if(j>=n2 || i<n1 && L[i] <= R[j])
                arr[k] = L[i++];
            else
                arr[k] = R[j++];
            k++;
        }
    }

    public void merge_sort(int []arr, int start, int end, int numberOfCalls) {
        numberOfCalls-=2;
        if(start >= end) return;
        int mid = (start + end) / 2;
        if(mid > 0)
            swap(arr, mid, mid-1);
        if(numberOfCalls == 0 || isSorted(arr)) {
            if(numberOfCalls != 0)
                numberOfCallsNotZero = true;
            return;
        }

        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
        //merge(arr, start, mid, end, numberOfCalls);
    }

    public void solve(int arr[], int numberOfCalls) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls);
    }

    public static boolean numberOfCallsNotZero = false;
    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		if(numberOfCalls == 1) {
        		for(int i=0; i<arr.length; i++)
        		    out.print(arr[i] + " ");
        		out.println();
    		} else if(numberOfCalls % 2 == 0) {
    		        out.print(-1);
    		} else {
        		merge.solve(arr, numberOfCalls-1);
        		if(numberOfCallsNotZero) {
        		    out.print(-1);
        		} else {
            		for(int i=0; i<arr.length; i++)
            		    out.print(arr[i] + " ");
            		out.println();
        		}
    		}
		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge_sort(int []arr, int l, int r, int k, int[] count) {

        if((count[0] >= k) || ( l == r - 1 )) return;
        int mid = (l + r) / 2;
        swap(arr, mid-1, mid);
        count[0] +=2;

        merge_sort(arr, l, mid, k, count);
        merge_sort(arr, mid, r, k, count);
    }

    public void solve(int arr[], int N, int k, int[] count) {
        merge_sort(arr, 0, N, k, count);
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int k = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		int count[] = {1};
    		merge.solve(arr, N, k, count);
    		if (count[0] != k)
    		    out.print(-1);
    		else {
        		for(int i=0; i<arr.length; i++) {
        		    out.print(arr[i] + " ");
        		}
    		}
    		out.println();

		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public boolean isSorted(int arr[]) {
        for(int i=1; i<arr.length; i++) {
            if(arr[i-1] > arr[i])
                return false;
        }
        return true;
    }

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge(int [] arr, int start, int mid, int end, int numberOfCalls) {
        int n1 = mid - start + 1;
        int n2 = end - mid;

        int L[] = new int[n1];
        int R[] = new int[n2];

        for(int i=0; i<n1; i++)
            L[i] = arr[i+start];
        for(int i=0; i<n2; i++)
            R[i] = arr[i+mid+1];

        int i=0, j=0, k=start;
        while(k<=end) {
            if(j>=n2 || i<n1 && L[i] <= R[j])
                arr[k] = L[i++];
            else
                arr[k] = R[j++];
            k++;
        }
    }

    public void merge_sort(int []arr, int start, int end, int numberOfCalls) {
        numberOfCalls-=2;
        if(start >= end) return;
        int mid = (start + end) / 2;
        if(mid > 0)
            swap(arr, mid, mid-1);
        if(numberOfCalls == 0 || isSorted(arr)) {
            numberOfCallsNotZero = true;
            return;
        }

        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
        merge(arr, start, mid, end, numberOfCalls);
    }

    public void solve(int arr[], int numberOfCalls) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls);
    }

    boolean static numberOfCallsNotZero = false;
    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		merge.solve(arr, numberOfCalls-1);
    		if(numberOfCallsNotZero) {
    		    out.print(-1);
    		} else {
        		for(int i=0; i<arr.length; i++)
        		    out.print(arr[i] + " ");
        		out.println();
    		}
		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge_sort(int []arr, int l, int r, int k, int[] count) {

        if((count[0] >= k) || ( l == r - 1 )) return;
        int mid = (l + r) / 2;
        swap(arr, mid-1, mid);
        count[0] +=2;

        merge_sort(arr, start, mid, k, count);
        merge_sort(arr, mid, end, k, count);
    }

    public void solve(int arr[], int k, int[] count) {
        merge_sort(arr, 0, arr.length-1, k, count);
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int k = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		int count[] = {1};
    		merge.solve(arr, k, count);
    		if (count[0] != k)
    		    out.print(-1);
    		else {
        		for(int i=0; i<arr.length; i++) {
        		    out.print(arr[i] + " ");
        		}
    		}
    		out.println();

		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public boolean isSorted(int arr[]) {
        for(int i=1; i<arr.length; i++) {
            if(arr[i-1] > arr[i])
                return false;
        }
        return true;
    }

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge(int [] arr, int start, int mid, int end, int numberOfCalls) {
        int n1 = mid - start + 1;
        int n2 = end - mid;

        int L[] = new int[n1];
        int R[] = new int[n2];

        for(int i=0; i<n1; i++)
            L[i] = arr[i+start];
        for(int i=0; i<n2; i++)
            R[i] = arr[i+mid+1];

        int i=0, j=0, k=start;
        while(k<=end) {
            if(j>=n2 || i<n1 && L[i] <= R[j])
                arr[k] = L[i++];
            else
                arr[k] = R[j++];
            k++;
        }
    }

    public void merge_sort(int []arr, int start, int end, int numberOfCalls) {
        numberOfCalls-=2;
        if(start >= end) return;
        int mid = (start + end) / 2;
        if(mid > 0)
            swap(arr, mid, mid-1);
        if(numberOfCalls == 0 || isSorted(arr)) {
            if(numberOfCalls != 0)
                numberOfCallsNotZero = true;
            return;
        }

        merge_sort(arr, start, mid, numberOfCalls);
        merge_sort(arr, mid+1, end, numberOfCalls);
        //merge(arr, start, mid, end, numberOfCalls);
    }

    public void solve(int arr[], int numberOfCalls) {
        merge_sort(arr, 0, arr.length-1, numberOfCalls);
    }

    public static boolean numberOfCallsNotZero = false;
    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int numberOfCalls = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		if(numberOfCalls == 1) {
        		for(int i=0; i<arr.length; i++)
        		    out.print(arr[i] + " ");
        		out.println();
    		} else {
        		merge.solve(arr, numberOfCalls-1);
        		if(numberOfCallsNotZero) {
        		    out.print(-1);
        		} else {
            		for(int i=0; i<arr.length; i++)
            		    out.print(arr[i] + " ");
            		out.println();
        		}
    		}
		out.close();
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class MergeSort {

    public void swap(int [] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    public void merge_sort(int []arr, int l, int r, int k, int[] count) {

        if((count[0] >= k) || ( l == r - 1 )) return;
        int mid = (l + r) / 2;
        swap(arr, mid-1, mid);
        count[0] +=2;

        merge_sort(arr, l, mid, k, count);
        merge_sort(arr, mid, r, k, count);
    }

    public static PrintWriter out;
	public static void main (String[] args) throws java.lang.Exception {
		out = new PrintWriter(new BufferedOutputStream(System.out), true);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    		String[] integersInString = br.readLine().split(" ");
    		int N = Integer.parseInt(integersInString[0]);
    		int k = Integer.parseInt(integersInString[1]);

    		int arr[] = new int [N];
    		for(int i=0; i <N; i++) {
    		    arr[i] = i+1;
    		}

    		MergeSort merge = new MergeSort();
    		int count[] = {1};

    		merge.merge_sort(arr, 0, arr.length, k, count);

    		if (count[0] != k)
    		    out.print(-1);
    		else {
        		for(int i=0; i<arr.length; i++) {
        		    out.print(arr[i] + " ");
        		}
    		}
    		out.println();

		out.close();
	}
}