#include <bits/stdc++.h>
using namespace std;
int main() {
  long long s, x;
  ios::sync_with_stdio(false);
  long long ans, y;
  while (cin >> s >> x) {
    ans = 1;
    y = 0;
    if (s == x) y = 2;
    if (s - x < 0 || (s - x) % 2)
      cout << "0" << endl;
    else if (((s - x) / 2) & x)
      cout << "0" << endl;
    else {
      while (x) {
        if (x % 2 == 1) ans *= 2;
        x /= 2;
        ;
      }
      ans -= y;
      cout << ans << endl;
    }
  }
}
