a,b=map(int,input().split()) r=1+(a==b) while a+b: if(a+b)&1:r*=2*(b&1) a>>=1 b>>=1 print(r//2)