#include <bits/stdc++.h>
using namespace std;
const int N = 200020;
int cnt;
vector<int> mergesort(int l, int r, vector<int> v) {
  if (cnt < 0) {
    printf("-1\n");
    exit(0);
  }
  if (l + 1 == r) return v;
  if (!cnt) {
    return v;
  }
  int mid = (l + r) / 2;
  cnt -= 2;
  vector<int> L, R;
  int sz = v.size() / 2;
  swap(v[sz - 1], v[sz]);
  for (int i = 0; i < v.size(); i++)
    if (i < sz)
      L.push_back(v[i]);
    else
      R.push_back(v[i]);
  L = mergesort(l, mid, L);
  R = mergesort(mid, r, R);
  v.clear();
  for (auto u : L) v.push_back(u);
  for (auto u : R) v.push_back(u);
  return v;
}
int main(void) {
  int n;
  cin >> n >> cnt;
  cnt--;
  vector<int> v;
  for (int i = 1; i <= n; i++) v.push_back(i);
  vector<int> w = mergesort(0, n, v);
  if (cnt) {
    printf("-1\n");
    return 0;
  }
  for (auto u : w) cout << u << " ";
  cout << endl;
  return 0;
}
