#yuki1915 import heapq N, K = map(int, input().split()) q = [(0,0, [])] #sum upper heapq.heapify(q) while q: s, u, vis = heapq.heappop(q) for a in range(u + 1, N + 1): ns = s + a nu = a nvis = vis + [a] if ns == K: print(len(nvis)) print(" ".join(map(str, nvis))) exit() if a < N: heapq.heappush(q, (ns, nu, nvis)) print(-1)