use std::io::Read; fn main() { let mut s: String = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let a: usize = itr.next().unwrap().parse().unwrap(); let mut b: usize = itr.next().unwrap().parse().unwrap(); // まずaのビットがbで全部立ってるか確認 let mut i: usize = 0; while a >> i > 0 || b >> i > 0 { if a >> i & 1 == 1 && b >> i & 1 == 0 { println!("0"); return; } i += 1; } b ^= a; i = 0; let mut ans: u64 = 1; while b >> i > 0 { if b >> i & 1 == 1 { ans *= 2; } i += 1; } println!("{}", ans / 2); }