K,X = map(int,input().split()) if K==0: X +=1 if X&(X-1)!=0: print("No") else: n = X.bit_length() - 1 #自由度 bit = bin(K).count("1") if bit>=5: res = [] c = 0 for i in range(20): if K>>i & 1: if c<=4: res.append(1<>i & 1: res.append(1<>j & 1: tmp += res[j] res.append(tmp) print("Yes") print(len(res)) print(*res)