#include <bits/stdc++.h>
using namespace std;
long long binPow(long long a, long long b, long long Mo) {
  long long ans = 1;
  for (; b; b >>= 1, a = a * a % Mo)
    if (b & 1) ans = ans * a % Mo;
  return ans;
}
int ct = 0;
void mergesort(int ar[], int l, int r, int &ch, int n) {
  ct++;
  if (r - l == 1) {
    return;
  }
  if (ch == 0 || ch == 1) {
    if (ch == 1) ch--;
    sort(ar + l, ar + r);
    return;
  }
  if (ch > 1 && r - l == n) {
    ch -= 3;
  } else {
    ch -= 2;
  }
  int m = (l + r) / 2;
  mergesort(ar, l, m, ch, n);
  mergesort(ar, m, r, ch, n);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  if (k % 2 == 0) {
    cout << -1 << endl;
    return 0;
  }
  int ar[n];
  for (int i = 0; i < n; i++) {
    ar[i] = n - i;
  }
  mergesort(ar, 0, n, k, n);
  if (k > 0) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    cout << ar[i] << " ";
  }
  cout << endl;
  return 0;
}
