using static System.Math; using System; public class Hello { public static long a, b; static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); a = long.Parse(line[0]); b = long.Parse(line[1]); getAns(); } static bool check(long t, int p) => ((t >> p) & 1) == 1; static void getAns() { var count = 0; for (int i = 0; i < 32; i++) { if (check(a, i) && !check(b, i)) { Console.WriteLine(0); return; } if (!check(a, i) && check(b, i)) count++; } if (count <= 1) Console.WriteLine(1); else Console.WriteLine(Pow(2, count - 1)); } }