A,B=map(int,input().split()) if A&B != A: print(0) exit() print(pow(2,A.bit_count()))