#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
ostream& operator<<(ostream& out, const pair<A, B>& a) {
  return out << "(" << a.first << ", " << a.second << ")";
}
template <class A>
ostream& operator<<(ostream& out, const vector<A>& a) {
  out << "[";
  for (auto it = a.begin(); it != a.end(); ++it) {
    if (it != a.begin()) out << ", ";
    out << *it;
  }
  return out << "]";
}
long long n, k;
vector<long long> rec(long long i, long long j) {
  vector<long long> v1, v2, v;
  if (i > j) return v;
  if (k > 1 && j > i) {
    k -= 2;
    long long mid = (i + j) / 2;
    v1 = rec(mid + 1, j);
    v2 = rec(i, mid);
    for (auto p : v1) v.push_back(p);
    for (auto p : v2) v.push_back(p);
  } else {
    for (long long x = i; x <= j; x++) v.push_back(x);
  }
  return v;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long i, j, x, t, y;
  cin >> n >> k;
  if (k % 2 == 0) {
    cout << "-1";
    return 0;
  }
  k--;
  vector<long long> v = rec(1, n);
  if (k == 0) {
    for (auto p : v) cout << p << " ";
  } else
    cout << "-1";
}
