#include <bits/stdc++.h>
using namespace std;
struct node {
  node *l, *r;
  int k;
  node() : l(NULL), r(NULL) { k = 0; }
} * root;
int k;
void build(node *n, int l, int r) {
  if (l == r) {
    n->k = l;
    return;
  }
  int mid = (l + r) / 2;
  n->l = new node();
  n->r = new node();
  if (k <= 0) {
    build(n->l, l, mid);
    build(n->r, mid + 1, r);
  } else {
    k -= 2;
    if ((r - l) % 2 == 0) {
      build(n->l, mid + 1, r);
      build(n->r, l, mid);
    } else {
      build(n->l, mid + 1, r);
      build(n->r, l, mid);
    }
  }
}
void print(node *n) {
  if (!n->l) {
    printf("%d ", n->k);
  } else {
    print(n->l);
    print(n->r);
  }
}
int main() {
  int n;
  scanf("%d %d", &n, &k);
  k--;
  root = new node();
  build(root, 1, n);
  if (k != 0) {
    printf("-1\n");
  } else {
    print(root);
  }
}
