#include <bits/stdc++.h>
using namespace std;
int n, k;
const int N = 1E5 + 7;
int a[N << 1];
void gao(int l, int r) {
  if (k <= 0 || l + 1 == r) {
    sort(a + l, a + r);
    return;
  }
  int m = (l + r) >> 1;
  k -= 2;
  gao(l, m);
  gao(m, r);
}
int main() {
  std::ios::sync_with_stdio(false), cin.tie(0);
  cin >> n >> k;
  k--;
  for (int i = 0; i < n; i++) a[i] = n - i;
  gao(0, n);
  if (k == 0) {
    for (int i = 0; i < n; i++) cout << a[i] << ' ';
  } else
    cout << -1 << endl;
  return 0;
}
