#include <bits/stdc++.h>
using namespace std;
int n, k;
vector<int> a(100010);
void mergesort(int L, int R, int l, int r) {
  if (k <= 0) {
    for (int i = L, j = l; i < R; i++, j++) a[i] = j;
    return;
  }
  if (L == R - 1) {
    a[L] = l;
    return;
  }
  int mid1 = (L + R) / 2, mid2 = (l + r + 1) / 2;
  k -= 2;
  mergesort(L, mid1, mid2, r);
  mergesort(mid1, R, l, mid2);
  return;
}
int main() {
  cin >> n >> k;
  k--;
  mergesort(0, n, 1, n + 1);
  if (k != 0)
    printf("-1\n");
  else {
    for (int i = 0; i < n; i++) cout << a[i] << " ";
    cout << endl;
  }
  return 0;
}
