def solve(): A, B = map(int, input().split()) if A & B != A: return 0 if A == B: return 1 return 2 ** f"{A ^ B:018b}".count('1') // 2 print(solve())