#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& p) {
  os << "[ ";
  for (T x : p) os << x << " ";
  os << "]" << endl;
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& p) {
  os << "{ ";
  for (T x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const multiset<T>& p) {
  os << "{ ";
  for (T x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const map<Tk, Tv>& p) {
  os << "{ ";
  for (pair<Tk, Tv> x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const pair<Tk, Tv>& p) {
  os << "{" << p.first << ',' << p.second << "}";
  return os;
}
long long gcd(long long a, long long b) { return (a ? gcd(b % a, a) : b); }
long long power(long long a, long long n) {
  long long p = 1;
  while (n > 0) {
    if (n & 1) {
      p = p * a;
    }
    n >>= 1;
    a *= a;
  }
  return p;
}
long long power(long long a, long long n, long long mod) {
  long long p = 1;
  while (n > 0) {
    if (n & 1) {
      p = p * a;
      p %= mod;
    }
    n >>= 1;
    a *= a;
    a %= mod;
  }
  return p % mod;
}
int n, k;
int a[100005];
void f(int l, int r, int x) {
  if (l + 1 == r) {
    a[l] = x;
    return;
  }
  if (k == 0) {
    for (int i = l; i < r; i++) a[i] = x + i - l;
    return;
  }
  k -= 2;
  int mid = (l + r) / 2;
  f(l, mid, x + r - mid);
  f(mid, r, x);
}
int main() {
  int i, j;
  scanf("%d", &n), scanf("%d", &k);
  if (k % 2 == 0) {
    puts("-1");
    return 0;
  }
  k--;
  f(0, n, 0);
  if (k > 0) {
    puts("-1");
    return 0;
  }
  for (i = 0; i < n; i++) printf("%d ", a[i] + 1);
  puts("");
  return 0;
}
