#include <bits/stdc++.h>
using namespace std;
const long long N = 1000005;
const long long mod = 1e9 + 7;
long long n, c, k;
vector<pair<long long, long long> > v;
long long a[N];
void mergesort(long long l, long long r) {
  if (l + 1 == r) return;
  if (k >= 2) {
    k -= 2;
    long long mid = (l + r) / 2;
    mergesort(l, mid);
    mergesort(mid, r);
  } else {
    v.push_back({l, r});
  }
}
void solve() {
  long long x = 0, y = 0, ans = 1;
  long long m;
  cin >> n >> k;
  for (long long i = 0; i < n; ++i) {
    a[i] = 0;
  }
  k--;
  c++;
  mergesort(0, n);
  if (k) {
    cout << -1 << "\n";
    return;
    ;
  }
  for (long long i = (long long)(v.size()) - 1; i >= 0; --i) {
    for (long long j = v[i].first; j < v[i].second; ++j) {
      a[j] = c++;
    }
  }
  for (long long i = n - 1; i >= 0; --i) {
    if (a[i] == 0) a[i] = c++;
  }
  for (long long i = 0; i < n; i++) cout << a[i] << " ";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
