-- Try yukicoder -- author: Leonardone @ NEETSDKASU import Data.Bits main = interact $ show . solve . map read . words solve :: [Integer] -> Integer solve [a, b] = ans where c = xor a b e = a .&. c p = popCount c ans = if e /= 0 then 0 else max 1 $ div (2 ^ p) 2