k, x = map(int, input().split()) if x == 0: print("Yes") print(1) print(k ^ 1) exit() if k == 0: x += 1 logx = x.bit_length() - 1 if 2**logx != x: print("No") exit() ans = [] point = 0 for i in range(1, 2**20): ans.append(i) if i&-i != i: point += 1 if point != logx: ans.append(i) point += 1 if point == logx: break if 2**(max(ans).bit_length()) < k: ans.append(k) print("Yes") print(len(ans)) print(*ans)