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 x = 1L; var imax = 0; var abmax = Max(a, b); for (int i = 0; i < 31; i++) { if (x >= abmax) { imax = i; break; } x *= 2; } var count = 0; for (int i = 0; i < imax; i++) { if (check(a, i) && !check(b, i)) { Console.WriteLine(0); return; } if (!check(a, i) && check(b, i)) { Console.WriteLine("i = {0}", i); count++; } } if (count <= 1) Console.WriteLine(1); else Console.WriteLine(Pow(2, count - 1)); } }