#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int n, k;
void solve(int l, int r) {
  if (k <= 0) return;
  if (l >= r) return;
  int mid = (l + r) / 2;
  vector<int> ld;
  int lower = mid + 1;
  for (int i = lower; i <= r; i++) ld.push_back(v[i]);
  for (int i = l; i < lower; i++) ld.push_back(v[i]);
  int j = 0;
  for (int i = l; i <= r; i++) v[i] = ld[j++];
  k -= 2;
  if ((r - l) % 2 == 0) mid--;
  solve(l, mid);
  solve(mid + 1, r);
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) v.push_back(i + 1);
  k--;
  solve(0, n - 1);
  if (k != 0)
    cout << -1 << endl;
  else {
    for (auto x : v) cout << x << ' ';
    cout << endl;
  }
}
