import sys A,B = list(map(int,input().split())) count = 0 for i in range(32): mask = 1 << i if A & mask and B & mask == 0: print(0) exit() if A & mask == 0 and B & mask == 1: count += 1 print(2 ** count)