#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, l, r, m;
  cin >> n >> k;
  deque<pair<int, int>> bfs;
  vector<int> lines;
  vector<int> ans(n);
  --k;
  bfs.push_back({0, n});
  while (!bfs.empty()) {
    l = bfs[0].first;
    r = bfs[0].second;
    m = (l + r) / 2;
    bfs.pop_front();
    if (k > 0 && r - l > 1) {
      k -= 2;
      lines.push_back(m);
      bfs.push_back({l, m});
      bfs.push_back({m, r});
    }
  }
  if (k != 0) {
    cout << -1;
    return 0;
  } else {
    int num = 1;
    lines.push_back(0);
    lines.push_back(n);
    sort(lines.begin(), lines.end());
    for (int i = lines.size() - 2; i >= 0; --i) {
      for (int j = lines[i]; j != lines[i + 1]; ++j) {
        ans[j] = num;
        ++num;
      }
    }
  }
  for (int i = 0; i != n; ++i) {
    cout << ans[i] << ' ';
  }
  return 0;
}
