#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const int mod = 1e9 + 7;
vector<pair<int, int> > res;
int n, k, cur;
void ms(int l, int r) {
  if (r - l == 1 || cur >= k) {
    res.push_back({l, r});
    return;
  }
  cur += 2;
  int mid = (l + r) / 2;
  ms(l, mid);
  ms(mid, r);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  cur = 1;
  ms(0, n);
  if (cur != k) {
    cout << -1 << endl;
    return 0;
  }
  int tmp = 1;
  vector<int> ans(n, 0);
  reverse(res.begin(), res.end());
  for (auto x : res) {
    for (int i = x.first; i < x.second; i++) {
      ans[i] = tmp;
      tmp++;
    }
  }
  for (auto x : ans) cout << x << " ";
}
