import sys input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) INF = 2 ** 63 - 1 mod = 998244353 n, s = mi() ans = [] summ = 0 for i in range(n, 0, -1): if summ + i <= s: ans.append(i) summ += i print(len(ans)) print(*ans)