A, B = map(int, input().split()) if A & ~B != 0: print(0) exit() C = (A ^ B).bit_count() if C == 0: print(1) else: print(2 ** (C - 1))