def r;gets.split.map &:to_i;end
M,K = r
A = Array.new(2**M,&:itself)
if (M == 1 && K == 1) || K >= 2**M
  puts -1
  exit
end
if M == 1 && K == 0
  puts "1 1 0 0"
  exit
end
A.delete(K)
puts [A + [K] + A.reverse + [K]].join(" ")