#include <bits/stdc++.h>
static constexpr int MAXN = 2010;
static constexpr int INF = std::numeric_limits<int>::max();
static constexpr int LOG = 40;
int get_lead(long long mask) {
  for (int i = LOG - 1; i >= 0; i--) {
    if (mask & (1LL << i)) {
      return i;
    }
  }
  return -1;
}
int main() {
  long long make_sum, make_xor;
  std::scanf("%lld %lld", &make_sum, &make_xor);
  long long curr_sum = 0;
  long long options = 0;
  int lead = get_lead(make_xor);
  for (int i = 0; i <= lead; i++) {
    if (make_xor & (1LL << i)) {
      curr_sum |= (1LL << i);
    } else {
      options |= (1LL << i);
    }
  }
  make_sum -= curr_sum;
  if (make_sum < 0 || make_sum & 1) {
    std::puts("0");
    return 0;
  }
  bool ok = true;
  make_sum >>= 1;
  for (int i = 0; i <= lead; i++) {
    if (make_sum & (1LL << i)) {
      if (!(options & (1LL << i))) {
        ok = false;
        break;
      }
      options &= ~(1LL << i);
    }
  }
  if (!ok) {
    std::cout << "0" << std::endl;
  } else {
    long long answer = 1LL << __builtin_popcountll(curr_sum);
    if (make_sum == 0) answer -= 2;
    std::cout << answer << std::endl;
  }
  return EXIT_SUCCESS;
}

### Prompt

Please create a solution in Cpp 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>
static constexpr int MAXN = 2010;
static constexpr int INF = std::numeric_limits<int>::max();
static constexpr int LOG = 40;
int get_lead(long long mask) {
  for (int i = LOG - 1; i >= 0; i--) {
    if (mask & (1LL << i)) {
      return i;
    }
  }
  return -1;
}
int main() {
  long long make_sum, make_xor;
  std::scanf("%lld %lld", &make_sum, &make_xor);
  long long curr_sum = 0;
  long long options = 0;
  int lead = get_lead(make_xor);
  for (int i = 0; i <= lead; i++) {
    if (make_xor & (1LL << i)) {
      curr_sum |= (1LL << i);
    } else {
      options |= (1LL << i);
    }
  }
  make_sum -= curr_sum;
  if (make_sum < 0 || make_sum & 1) {
    std::puts("0");
    return 0;
  }
  bool ok = true;
  make_sum >>= 1;
  for (int i = 0; i <= lead; i++) {
    if (make_sum & (1LL << i)) {
      if (!(options & (1LL << i))) {
        ok = false;
        break;
      }
      options &= ~(1LL << i);
    }
  }
  if (!ok) {
    std::cout << "0" << std::endl;
  } else {
    long long answer = 1LL << __builtin_popcountll(curr_sum);
    if (make_sum == 0) answer -= 2;
    std::cout << answer << std::endl;
  }
  return EXIT_SUCCESS;
}

```