#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18 + 1;
const int MOD = 1e9 + 7;
const int dx[] = {+1, -1, 0, 0};
const int dy[] = {0, 0, +1, -1};
const int N = 5e4 + 5;
void frepik() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
}
vector<int> a;
int n, k;
void go(int l, int r) {
  int m = (l + r) / 2;
  if (k == 0) return;
  if (l + 1 == r) return;
  k -= 2;
  reverse(a.begin() + l, a.begin() + r + 1);
  reverse(a.begin() + l, a.begin() + m + 1);
  reverse(a.begin() + m, a.begin() + r + 1);
  go(l, m);
  go(m, r);
}
int main() {
  frepik();
  cin >> n >> k;
  if (k % 2 == 0) cout << -1, exit(0);
  a.resize(n);
  for (int i = 0; i < n; i++) a[i] = i + 1;
  k--;
  go(0, n);
  if (k > 0) cout << -1, exit(0);
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  return 0;
}
