#include <bits/stdc++.h>
using namespace std;
int ans[200000], n, k;
void f(vector<int> v, int l, int r, int &k) {
  if (k == 0 || l + 1 == r || k == 1) {
    for (int i = 0; i < v.size(); ++i) ans[i + l] = v[i];
    return;
  }
  vector<int> R, L;
  int mid = (l + r) / 2;
  int pos = 0;
  for (int i = mid; i < r; ++i) L.push_back(v[pos]), ++pos;
  for (int i = pos; i < v.size(); ++i) R.push_back(v[i]);
  k -= 2;
  f(R, l, mid, k);
  f(L, mid, r, k);
}
int main() {
  cin >> n >> k;
  vector<int> a;
  for (int i = 1; i <= n; ++i) a.push_back(i);
  --k;
  f(a, 0, n, k);
  if (k != 0) return cout << -1 << endl, 0;
  for (int i = 0; i < n; ++i) cout << ans[i] << ' ';
}
