#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, k;
int cnt;
void dfs(int l, int r) {
  if (r == l + 1) {
    printf("%d ", l + 1);
    return;
  }
  if (cnt + 2 <= k) {
    int mid = (l + r + 1) >> 1;
    cnt += 2;
    dfs(mid, r);
    dfs(l, mid);
  } else {
    int mid = (l + r) >> 1;
    dfs(l, mid);
    dfs(mid, r);
  }
}
int main() {
  n = read();
  k = read();
  if (k % 2 == 0 || k > 2 * n - 1) {
    cout << -1 << endl;
    return 0;
  } else
    dfs(0, n);
  return 0;
}
