#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x, y;
  cin >> x >> y;
  long long z = x - y;
  cout << (z < 0 || z & 1 || (z / 2) & y
               ? 0
               : (1ll << __builtin_popcountll(y)) - 2 * (x == y));
}
