import std.stdio, std.conv, std.array, std.math;

void main() {
    string[] input = readln.split;
    int m = input[0].to!int;
    int k = input[1].to!int;
    int n = pow(2, m);
    if(k != 0) {
        writeln(-1);
        return;
    }
    foreach(i; 0..n) {
        write(i);
        write(" ");
        write(i);
        if(i != n - 1){
            write(" ");
        }
    }
    writeln("");
}
