#include <bits/stdc++.h>   using namespace std;   struct Segment {     int l, r, x, ls, rs, fa;   } seg[2000100];   int n, k, p[100100], cnt, pnt, b[2000100], w, ans[100100], res;   int Dfs(int &id, int l, int r) {     id = ++cnt;     seg[id].l = l, seg[id].r = r;     seg[id].x = 1;     if (r - l == 1) return 1;     int mid = (l + r) >> 1;     seg[id].x += Dfs(seg[id].ls, l, mid);     seg[id].x += Dfs(seg[id].rs, mid, r);     return seg[id].x;   }   void Vis(int x) {     if (!x) return;     b[x] = 1;     Vis(seg[x].ls);     Vis(seg[x].rs);   }   bool cmp(int x, int y) { return seg[x].l < seg[y].l; }   void Solve(int x) {     if (!x) return;     if (b[x]) {       for (int i = seg[x].l; i < seg[x].r; i++) ans[i] = res++;       return;     }     Solve(seg[x].rs);     Solve(seg[x].ls);   }   int main() {     scanf( %d%d , &n, &k);     Dfs(w, 0, n);     k = seg[1].x - k;     for (int i = 1; i <= cnt; i++)       if (!b[i]) {         if (k >= seg[i].x - 1 && seg[i].x > 1) {           k -= seg[i].x - 1;           p[++pnt] = i;           Vis(i);           if (!k) break;         }       }     if (k)       printf( -1 );     else {       res = 1;       Solve(1);       for (int i = n - 1; i >= 0; i--) ans[i] = ans[i] ? ans[i] : res++;       for (int i = 0; i < n; i++) printf( %d  , ans[i]);     }     return 0;   }   