#include <bits/stdc++.h>
using namespace std;
struct __s {
  __s() {
    srand(time(NULL));
    if (1) {
      ios_base::Init i;
      cin.sync_with_stdio(0);
      cin.tie(0);
    }
  }
  ~__s() {
    if (!1)
      fprintf(stderr, "Execution time: %.3lf s.\n",
              (double)clock() / CLOCKS_PER_SEC);
    long long n;
    cin >> n;
  }
} __S;
long long s, x;
long long solve() {
  long long ans = 1;
  bool res = false;
  bool ok = true;
  long long sum = 0;
  for (long long ii = 0; ii < (long long)(41); ii++) {
    long long i = 40 - ii;
    bool a = (s & (1LL << i));
    bool b = (x & (1LL << i));
    if (!a && !b && !res) {
      continue;
    } else if (!a && !b && res) {
      sum += (1LL << i) * 2;
      res = false;
      ok = false;
    } else if (!a && b) {
      sum += (1LL << i);
      ans *= 2;
    } else if (a && !b && !res) {
      res = true;
    } else if (a && !b && res) {
      sum += (1LL << i) * 2;
      ok = false;
    } else if (a && b && !res) {
      sum += (1LL << i);
      ans *= 2;
    } else if (a && b && res) {
      return 0;
    }
  }
  if (sum > s) return 0;
  if (res || ok && ans == 2) return 0;
  if (ok) ans -= 2;
  return ans;
}
void test() {
  s = rand() % (1 << 11) + 2;
  x = rand() % (1 << 11);
}
long long brute() {
  long long ans = 0;
  for (long long a = 1; a < s; a++) {
    long long b = s - a;
    if ((a ^ b) == x) {
      ans++;
    }
  }
  return ans;
}
int main(void) {
  cin >> s >> x;
  cout << solve() << '\n';
  return 0;
  while (true) {
    test();
    if (solve() != brute()) {
      cout << "error" << '\n';
      cout << s << " " << x << '\n';
      cout << solve() << " " << brute() << '\n';
    }
  }
  return 0;
}

### Prompt

Generate a CPP solution to the following problem:

Two positive integers a and b have a sum of s and a bitwise XOR of x. How many possible values are there for the ordered pair (a, b)?

Input

The first line of the input contains two integers s and x (2 ≤ s ≤ 1012, 0 ≤ x ≤ 1012), the sum and bitwise xor of the pair of positive integers, respectively.

Output

Print a single integer, the number of solutions to the given conditions. If no solutions exist, print 0.

Examples

Input

9 5


Output

4


Input

3 3


Output

2


Input

5 2


Output

0

Note

In the first sample, we have the following solutions: (2, 7), (3, 6), (6, 3), (7, 2).

In the second sample, the only solutions are (1, 2) and (2, 1).

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
struct __s {
  __s() {
    srand(time(NULL));
    if (1) {
      ios_base::Init i;
      cin.sync_with_stdio(0);
      cin.tie(0);
    }
  }
  ~__s() {
    if (!1)
      fprintf(stderr, "Execution time: %.3lf s.\n",
              (double)clock() / CLOCKS_PER_SEC);
    long long n;
    cin >> n;
  }
} __S;
long long s, x;
long long solve() {
  long long ans = 1;
  bool res = false;
  bool ok = true;
  long long sum = 0;
  for (long long ii = 0; ii < (long long)(41); ii++) {
    long long i = 40 - ii;
    bool a = (s & (1LL << i));
    bool b = (x & (1LL << i));
    if (!a && !b && !res) {
      continue;
    } else if (!a && !b && res) {
      sum += (1LL << i) * 2;
      res = false;
      ok = false;
    } else if (!a && b) {
      sum += (1LL << i);
      ans *= 2;
    } else if (a && !b && !res) {
      res = true;
    } else if (a && !b && res) {
      sum += (1LL << i) * 2;
      ok = false;
    } else if (a && b && !res) {
      sum += (1LL << i);
      ans *= 2;
    } else if (a && b && res) {
      return 0;
    }
  }
  if (sum > s) return 0;
  if (res || ok && ans == 2) return 0;
  if (ok) ans -= 2;
  return ans;
}
void test() {
  s = rand() % (1 << 11) + 2;
  x = rand() % (1 << 11);
}
long long brute() {
  long long ans = 0;
  for (long long a = 1; a < s; a++) {
    long long b = s - a;
    if ((a ^ b) == x) {
      ans++;
    }
  }
  return ans;
}
int main(void) {
  cin >> s >> x;
  cout << solve() << '\n';
  return 0;
  while (true) {
    test();
    if (solve() != brute()) {
      cout << "error" << '\n';
      cout << s << " " << x << '\n';
      cout << solve() << " " << brute() << '\n';
    }
  }
  return 0;
}

```