N,S = map(int,input().split()) import sys if S <= N: print(1) print(S) exit() M = N * (N + 1) // 2 if M - S <= N: ans = [] for i in range(1,N + 1): if i != M - S: ans.append(i) print(len(ans)) print(*ans) exit() tmp = 0 ans = [] for i in range(N,0,-1): if tmp + i <= S: ans.append(i) tmp += i else: break if S - tmp > 0: ans.append(S - tmp) print(len(ans)) print(*ans[::-1])