k,x=map(int,input().split()) if x==0: print("Yes") print(1) if k==0:print(1) else:print(0) exit() if k==0:x+=1 if 2**(x.bit_length()-1)!=x:exit(print("No")) x=x.bit_length()-1 ans=[0] x-=1 bitt=[0]*20 if k!=0:bitt[(k&-k).bit_length()-1]=-1 for i in range(20): if x>=4: if bitt[i]>=0 and bitt[i+1]>=0: bitt[i]=bitt[i+1]=2 x-=4 elif x: if bitt[i]==0: bitt[i]=1 x-=1 if bitt[0]>0:ans+=[1,1] for i in range(1,20): if bitt[i]>0:ans+=[2**i,2**i] if bitt[i-1]==bitt[i]==2: ans+=[2**i+2**(i-1),2**i+2**(i-1)] if k!=0:ans.append(k) print("Yes") print(len(ans)) print(*ans)