M, K = gets.split.map(&:to_i)

if M <= 1
  puts K == 0 ? (0 .. M).flat_map{|i| [i, i]}.join(' ') : -1
elsif K < 2**M
  as = [*0 ... 2**M] - [K]
  puts (as + [K] + as.reverse + [K]).join(' ')
else
  puts -1
end