#coding on smartphone a, b = map(int, input().split()) tmp = 0 for i in range(32): tmp += (b>>i ^ a>>i) & 1 print(2**(max(0,tmp-1)) if a&b == a else 0)