#include <bits/stdc++.h>
using namespace std;
int n, k;
int a[100000];
void f(int l, int r, int yk) {
  if (l + 1 == r || k == 0) {
    for (int i = l; i < r; i++) a[i] = ++yk;
    return;
  }
  if (k > 1) {
    int m = (l + r) / 2;
    k -= 2;
    f(l, m, yk + r - m);
    f(m, r, yk);
  }
}
int main() {
  cin >> n >> k;
  k--;
  for (int i = 0; i < n; i++) a[i] = -1;
  f(0, n, 0);
  if (k)
    cout << "-1";
  else {
    for (int i = 0; i < n; i++) cout << a[i] << " ";
  }
  return 0;
}
