#include <bits/stdc++.h>
using namespace std;
template <class T>
bool gmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool gmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
long long n, k, ptr = 1;
vector<long long> a;
template <typename T, typename S>
ostream& operator<<(ostream& os, const pair<T, S>& v) {
  os << "(";
  os << v.first << "," << v.second << ")";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "[";
  long long sz = v.size();
  for (long long i = 0; i < sz; ++i) {
    os << v[i];
    if (i != sz - 1) os << ",";
  }
  os << "]\n";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& v) {
  T last = *v.rbegin();
  os << "[";
  for (auto it : v) {
    os << it;
    if (it != last) os << ",";
  }
  os << "]\n";
  return os;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, const map<T, S>& v) {
  for (auto it : v) {
    os << it.first << " : " << it.second << "\n";
  }
  return os;
}
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
void go(long long l, long long r) {
  if (k < 0) return;
  if (l + 1 == r) {
    a[l] = ptr++;
    return;
  }
  if (k == 0) {
    for (long long i = l; i < (r); i++) a[i] = ptr++;
    return;
  }
  k -= 2;
  long long m = (l + r) / 2;
  go(m, r);
  go(l, m);
}
void solve() {
  cin >> n >> k;
  k--;
  if (k % 2) {
    cout << -1;
    return;
  }
  a.resize(n);
  go(0, n);
  if (k != 0) {
    cout << -1 << '\n';
    return;
  }
  for (auto x : a) cout << x << " ";
  cout << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
}
