#include <bits/stdc++.h>
using namespace std;
const long long oo = 1000000000000000000;
const int N = 100005;
int n, k;
int l;
int v[N];
void f(int L, int R) {
  if (R - L == 1) {
    v[L] = l--;
    return;
  }
  if (k == 0) {
    for (int i = R - 1; i >= L; i--) v[i] = l--;
    return;
  }
  k -= 2;
  int mid = (L + R) / 2;
  f(L, mid);
  f(mid, R);
}
int main() {
  scanf("%d %d", &n, &k);
  l = n;
  k--;
  f(0, n);
  if (k) return printf("-1\n"), 0;
  for (int i = 0; i < int(n); i++) printf("%d ", v[i]);
  printf("\n");
  return 0;
}
