#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
vector<int> v[1111111];
int now, n, k;
vector<int> msort(int l, int r) {
  vector<int> cur(r - l + 1);
  if (now == k) {
    for (long long o = (l); o < (r + 1); o++) cur[o - l] = o + 1;
    return cur;
  }
  if (l == r) {
    cur[0] = l + 1;
    return cur;
  }
  int mid = (l + r) >> 1;
  vector<int> a, b;
  now += 2;
  a = msort(l, mid);
  b = msort(mid + 1, r);
  for (auto x : a) b.push_back(x);
  return b;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  now = 1;
  if (k % 2 == 0) return cout << -1, 0;
  vector<int> ans = msort(0, n - 1);
  if (now < k)
    cout << -1;
  else
    for (auto x : ans) cout << x << ' ';
  return 0;
}
