func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long MOD = 1e9 + 7;   long long gcd(long long a, long long b, long long &x, long long &y) {     if (b == 0) {       x = 1;       y = 0;       return a;     }     long long x1, y1;     long long g = gcd(b, a % b, x1, y1);     x = y1;     y1 = x1 - y1 * (a / b);     return g;   }   long long qpow(long long a, long long n) {     long long res = 1;     while (n) {       if (n % 2) {         res = (res * a) % MOD;         n--;       } else {         n = n / 2;         a = (a * a) % MOD;       }     }     return res;   }   long long inv(long long a) { return qpow(a, MOD - 2); }   bool cmp(pair<long long, long long> &p1, pair<long long, long long> &p2) {     if (p1.first != p2.first) return p1.first < p2.first;     return p1.second < p2.second;   }   bool prime(long long n) {     for (long long i = 2; i * i <= n; i++) {       if (n % i == 0) return false;     }     return true;   }   long long sum(long long n) {     long long second = 0;     while (n) {       second += n % 10;       n /= 10;     }     return second;   }   void solve() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     ;     long long second, x;     cin >> second >> x;     long long c = 0;     vector<long long> a;     for (int i = 0; i < 42; i++) {       if (x & (1LL << i)) {         c++;         second -= (1LL << i);       } else         a.push_back(1LL << (i + 1));     }     if (second < 0) {       cout << 0 <<   n ;       return;     }     sort(a.begin(), a.end(), greater<long long>());     bool ok = false;     for (int i = 0; i < a.size(); i++) {       if (a[i] <= second) {         ok = true;         second -= a[i];       }     }     if (second == 0) {       if (ok)         cout << (1LL << c) <<   n ;       else {         cout << max(0LL, (1LL << c) - 2) <<   n ;       }     } else       cout << 0 <<   n ;   }   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     ;     int t = 1;     while (t--) {       solve();     }     return 0;   }   