#include <bits/stdc++.h>
using namespace std;
const long long int MAX = 150000;
void pls() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
inline long long int madd(long long int x, long long int y) {
  return (x % 1000000007 + y % 1000000007) % 1000000007;
}
inline long long int msub(long long int x, long long int y) {
  return (1000000007 + x % 1000000007 - y % 1000000007) % 1000000007;
}
int32_t main() {
  pls();
  long long int second, x;
  cin >> second >> x;
  if (second < x || (second - x) % 2 || x & (second - x) / 2) {
    cout << "0";
    return 0;
  }
  long long int res = 1LL << __builtin_popcountll(x);
  if (x == second) res -= 2;
  cout << res;
  return 0;
}
