#include <bits/stdc++.h>
using namespace std;
inline long long mod(long long n, long long m) {
  long long ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
long long gcd(long long a, long long b) {
  return (b == 0LL ? a : gcd(b, a % b));
}
long long exp(long long a, long long b, long long m) {
  if (b == 0LL) return 1LL;
  if (b == 1LL) return mod(a, m);
  long long k = mod(exp(a, b / 2, m), m);
  if (b & 1LL) {
    return mod(a * mod(k * k, m), m);
  } else
    return mod(k * k, m);
}
long long merge(long long l, long long r, vector<long long>& a) {
  bool ok = 1;
  for (long long i = l; i < r - 1; i++) {
    if (a[i] > a[i + 1]) ok = 0;
  }
  if (ok) return 0;
  if (l + 1 == r) return 0;
  long long mid = (l + r) / 2;
  long long res = merge(l, mid, a) + merge(mid, r, a);
  sort(a.begin() + l, a.begin() + r);
  return res + 2;
}
const long long N = 100100;
long long a[N];
void build(long long l, long long r, long long& k, long long add = 0) {
  if (k - 2 < 0 || l + 1 == r) {
    for (long long i = l; i < r; i++) {
      a[i] = add + i - l + 1;
    }
    return;
  }
  k -= 2;
  long long mid = (l + r) / 2;
  long long tam = (r - mid);
  build(l, mid, k, add + tam);
  build(mid, r, k, add);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, k;
  cin >> n >> k;
  k--;
  build(0, n, k);
  if (k == 0) {
    for (long long i = 0; i < n; i++) {
      cout << a[i] << " ";
    }
    cout << "\n";
  } else
    cout << -1 << "\n";
}
