#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int sum, XOR, AND;
  scanf("%I64d%I64d", &sum, &XOR);
  if ((sum - XOR) % 2) {
    printf("0\n");
    return 0;
  }
  AND = (sum - XOR) / 2;
  long long int ans = 1;
  for (long long int digit = 0; digit <= 60; digit++) {
    int a = 0, x = 0;
    if (AND & (1LL << digit)) a = 1;
    if (XOR & (1LL << digit)) x = 1;
    if (a) {
      if (x) ans = 0;
    } else {
      if (x) ans = ans * 2LL;
    }
  }
  if (XOR == sum) ans -= 2;
  printf("%I64d\n", ans);
  return 0;
}
