import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;

auto rdsp(){return readln.splitter;}
void pick(R,T)(ref R r,ref T t){t=r.front.to!T;r.popFront;}
void readV(T...)(ref T t){auto r=rdsp;foreach(ref v;t)pick(r,v);}

void main()
{
  int m, k; readV(m, k);

  if (m == 1) {
    writeln(k == 0 ? "0 0 1 1" : "-1");
    return;
  }

  if (k >= 2^^m) {
    writeln(-1);
    return;
  }

  foreach (i; 0..2^^m)
    if (i != k) write(i, " ");
  write(k, " ");
  foreach_reverse (i; 0..2^^m)
    if (i != k) write(i, " ");
  writeln(k);
}
