#include <bits/stdc++.h>
using namespace std;
long long bigmod(long long b, long long p) {
  if (p == 0) return 1;
  long long my = bigmod(b, p / 2);
  my *= my;
  my %= 1000000007;
  if (p & 1) my *= b, my %= 1000000007;
  return my;
}
int setb(int n, int pos) { return n = n | (1 << pos); }
int resb(int n, int pos) { return n = n & ~(1 << pos); }
bool checkb(int n, int pos) { return (bool)(n & (1 << pos)); }
int ara[500005];
int n, k;
bool issorted(int l, int r) {
  for (int i = l + 1; i < r; i++) {
    if (ara[i] < ara[i - 1]) return false;
  }
  return true;
}
int tmp[500005];
int cnt;
void Merge(int l, int r) {
  int mid = (l + r) / 2;
  int i = l;
  int j = mid;
  int k = 0;
  while (i < mid && j < r) {
    if (ara[i] < ara[j])
      tmp[k++] = ara[i++];
    else
      tmp[k++] = ara[j++];
  }
  while (i < mid) tmp[k++] = ara[i++];
  while (j < r) tmp[k++] = ara[j++];
  for (int i = l; i < r; i++) ara[i] = tmp[i - l];
}
void F(int l, int r) {
  cnt++;
  if (l == r) return;
  if (issorted(l, r)) return;
  int mid = (l + r) / 2;
  F(l, mid);
  F(mid, r);
  Merge(l, r);
}
void Print() {
  for (int i = 0; i < n; i++) printf("%d ", ara[i]);
  printf("\n");
}
vector<int> v[100005];
void prework() {
  v[1].push_back(1);
  v[2].push_back(1);
  v[2].push_back(3);
  for (int i = 3; i <= 20; i++) {
    int f = i / 2;
    int l = i - f;
    v[i].push_back(1);
    for (int j = 0; j < v[f].size(); j++) {
      for (int k = 0; k < v[l].size(); k++) {
        int my = v[f][j] + v[l][k] + 1;
        v[i].push_back(my);
      }
    }
    sort(v[i].begin(), v[i].end());
    v[i].erase(unique(v[i].begin(), v[i].end()), v[i].end());
    for (int j = 0; j < v[i].size(); j++) printf("%d ", v[i][j]);
    printf("\n");
  }
}
int ans[500005];
void make(int l, int r, int st, int ed) {
  int cur = st;
  for (int i = l; i < r; i++) ans[i] = cur++;
}
void go(int l, int r, int k, int st, int ed) {
  k--;
  if (k == 0) {
    make(l, r, st, ed);
    return;
  }
  assert(!(k & 1));
  int mid = (l + r) / 2;
  int item1 = mid - l;
  int item2 = r - l - item1;
  int val = (st + ed) / 2;
  if (item1 == item2) {
    int p1, p2;
    int my = k / 2;
    if (my & 1) {
      p1 = my;
      p2 = my;
    } else {
      p1 = my - 1;
      p2 = my + 1;
    }
    go(l, mid, p1, val, ed);
    go(mid, r, p2, st, val);
  } else {
    if ((k / 2) <= (item1 * 2 - 1)) {
      int p1, p2;
      int my = k / 2;
      if (my & 1) {
        p1 = my;
        p2 = my;
      } else {
        p1 = my - 1;
        p2 = my + 1;
      }
      go(l, mid, p1, val + 1, ed);
      go(mid, r, p2, st, val + 1);
    } else {
      int p1, p2;
      int my = k / 2;
      if (my & 1) {
        p1 = my - 2;
        p2 = my + 2;
      } else {
        p1 = my - 1;
        p2 = my + 1;
      }
      go(l, mid, p1, val + 1, ed);
      go(mid, r, p2, st, val + 1);
    }
  }
}
int main() {
  int i;
  scanf("%d %d", &n, &k);
  int flag = 1;
  if (!(k & 1)) flag = 0;
  if (k > (2 * n - 1)) flag = 0;
  if (!flag) {
    puts("-1");
    return 0;
  }
  go(0, n, k, 0, n);
  for (int i = 0; i < n; i++) {
    if (i) printf(" ");
    printf("%d", ans[i] + 1);
    ara[i] = ans[i] + 1;
  }
  printf("\n");
  F(0, n);
  assert(k == cnt);
  return 0;
}
