#include <bits/stdc++.h>
using namespace std;
vector<int> v(100055);
vector<pair<int, int> > to_change;
int per(int l, int r, int k) {
  if (k == 0) return 0;
  int m = (l + r) / 2;
  if (l == r) return k;
  if (r - l == 1) {
    to_change.push_back({l, m});
    to_change.push_back({m + 1, r});
    return k - 2;
  }
  if (k == 2) {
    to_change.push_back({l, m});
    to_change.push_back({m + 1, r});
    return 0;
  }
  if ((l + r) % 2 == 0) m--;
  int fh = per(l, m, k - 2);
  int sh = per(m + 1, r, fh);
  return sh;
}
void change(pair<int, int> x, pair<int, int> y) {
  vector<int> New;
  for (int i = 0; i < y.first; i++) New.push_back(v[i]);
  for (int i = x.first; i <= x.second; i++) New.push_back(v[i]);
  for (int i = y.first; i <= y.second; i++) New.push_back(v[i]);
  for (int i = x.second + 1; i < v.size(); i++) New.push_back(v[i]);
  v = New;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) v[i] = i;
  if (k % 2 == 0) {
    cout << -1;
    return 0;
  }
  int t = per(1, n, k - 1);
  if (t != 0) {
    cout << -1;
    return 0;
  }
  sort(to_change.begin(), to_change.end());
  int start = 1;
  for (int i = 0; i < int(to_change.size() - 1); i += 2) {
    for (int j = start; j < to_change[i].first; j++) cout << v[j] << " ";
    for (int j = to_change[i + 1].first; j <= to_change[i + 1].second; j++)
      cout << v[j] << " ";
    for (int j = to_change[i].first; j <= to_change[i].second; j++)
      cout << v[j] << " ";
    start = to_change[i + 1].second + 1;
  }
  for (int i = start; i <= n; i++) cout << v[i] << " ";
  return 0;
}
