m, k = gets.split.map(&:to_i)

n = 2**m - 1

if (k > n || (m == 1 && k == 1))
  puts(-1)
else
  as = if (k == 0) then [] else [k] end
  bs = (1..k-1).to_a + (k+1..n).to_a
  cs = [0] + as + [0] + bs + as + bs.reverse

  puts(cs.join(' '))
end
