let () = Scanf.scanf "%d %d\n" @@ fun m k ->
  if 0 < k then print_endline "-1"
  else begin
    for i = 0 to (1 lsl m) - 1 do
      Printf.printf "%d " i
    done;
    for i = (1 lsl m) - 1 downto 0 do
      Printf.printf "%d " i
    done;
  end