# 2020/01/02 a,b=map(int,input().split()) if a&b!=a: print(0) exit() bit=bin(a^b).count('1') print(pow(2,bit-1))