#include <bits/stdc++.h>
using namespace std;
int main() {
  long long s, x;
  cin >> s >> x;
  long long rest = s - x;
  if (rest < 0 || rest % 2LL == 1) {
    cout << 0;
    return 0;
  }
  rest >>= 1;
  int cnt = 0;
  for (int i = 0; i < 64; ++i) {
    bool inx = ((x & (1LL << i)) != 0);
    bool inrest = ((rest & (1LL << i)) != 0);
    cnt += inx;
    if (inrest && inx) {
      cout << 0;
      return 0;
    }
  }
  cout << (1LL << cnt) - 2LL * (s == x);
  return 0;
}
