import Foundation
let input = readLine()!.split(separator: " ").map { Int($0)! }

let M = input[0]
let K = input[1]

let N = Int(pow(2.0, Double(M)))

if N <= K {
  print("-1")
} else if M == 1 && K != 0 {
  print("-1")
} else if M == 1 && K == 0 {
  print("[0, 0, 1, 1]")
} else {
	var list = (0..<N).map { $0 }
	list.remove(at: K)
	print(list + [K] + list.reversed() + [K])
}