#include <bits/stdc++.h>
using namespace std;
long long s, x;
int32_t main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> s >> x;
  long long d = s - x;
  if (d & 1) return cout << 0 << endl, 0;
  d >>= 1;
  for (long long i = 0; i <= 63; i++)
    if ((x >> i) & 1 == 1 && (d >> i) & 1 != 0) return cout << 0 << endl, 0;
  cout << (1LL << (__builtin_popcountll(x))) - (s == x) * 2 << endl;
}
