#include <bits/stdc++.h>
using namespace std;
const int MAXK = 400005;
const int MAXN = 100005;
int N, K;
int a[MAXN], calls;
queue<pair<int, int> > q;
int main() {
  cin >> N >> K;
  for (int i = 1; i <= N; i++) {
    a[i] = N - i + 1;
  }
  q.push(make_pair(1, N + 1));
  calls = 1;
  while (!q.empty()) {
    pair<int, int> lr = q.front();
    q.pop();
    int l = lr.first;
    int r = lr.second;
    if (calls > K) {
      cout << -1 << endl;
      exit(0);
    } else if (calls < K && l != r - 1) {
      calls += 2;
      int mid = (l + r) / 2;
      q.push(make_pair(l, mid));
      q.push(make_pair(mid, r));
    } else {
      for (int j = l; j < (l + r) / 2; j++) {
        a[r - 1 - (j - l)] ^= a[j] ^= a[r - 1 - (j - l)] ^= a[j];
      }
    }
  }
  if (calls < K) {
    cout << -1 << endl;
    exit(0);
  }
  for (int i = 1; i <= N; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
}
