#include <bits/stdc++.h>
using namespace std;
int h;
long long s, x, dp[65][2][2][2];
void print(long long x) {
  if (!x) return;
  print(x >> 1);
  printf("%d", x & 1);
}
long long rec(int idx, bool rem, bool a, bool b) {
  if (idx == h) return (a and b and !rem);
  long long &temp = dp[idx][rem][a][b];
  if (temp != -1) return temp;
  temp = 0;
  bool is = (s & (1LL << idx));
  if (x & (1LL << idx)) {
    if (((rem + 1) & 1) == is) {
      temp += rec(idx + 1, (rem + 1) >> 1, a | 1, b) +
              rec(idx + 1, (rem + 1) >> 1, a, b | 1);
    }
  } else {
    if (((rem + 2) & 1) == is) {
      temp += rec(idx + 1, (rem + 2) >> 1, a | 1, b | 1);
    }
    if ((rem & 1) == is) {
      temp += rec(idx + 1, (rem) >> 1, a, b);
    }
  }
  return temp;
}
int main() {
  scanf("%I64d %I64d", &s, &x);
  long long z = s;
  while (z) {
    z >>= 1;
    ++h;
  }
  z = x;
  int q = 0;
  while (z) {
    z >>= 1;
    ++q;
  }
  if (q > h) return 0 * printf("0\n");
  memset(dp, 0xff, sizeof(dp));
  printf("%I64d\n", rec(0, 0, 0, 0));
  return 0;
}

### Prompt

Your task is to create 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;
int h;
long long s, x, dp[65][2][2][2];
void print(long long x) {
  if (!x) return;
  print(x >> 1);
  printf("%d", x & 1);
}
long long rec(int idx, bool rem, bool a, bool b) {
  if (idx == h) return (a and b and !rem);
  long long &temp = dp[idx][rem][a][b];
  if (temp != -1) return temp;
  temp = 0;
  bool is = (s & (1LL << idx));
  if (x & (1LL << idx)) {
    if (((rem + 1) & 1) == is) {
      temp += rec(idx + 1, (rem + 1) >> 1, a | 1, b) +
              rec(idx + 1, (rem + 1) >> 1, a, b | 1);
    }
  } else {
    if (((rem + 2) & 1) == is) {
      temp += rec(idx + 1, (rem + 2) >> 1, a | 1, b | 1);
    }
    if ((rem & 1) == is) {
      temp += rec(idx + 1, (rem) >> 1, a, b);
    }
  }
  return temp;
}
int main() {
  scanf("%I64d %I64d", &s, &x);
  long long z = s;
  while (z) {
    z >>= 1;
    ++h;
  }
  z = x;
  int q = 0;
  while (z) {
    z >>= 1;
    ++q;
  }
  if (q > h) return 0 * printf("0\n");
  memset(dp, 0xff, sizeof(dp));
  printf("%I64d\n", rec(0, 0, 0, 0));
  return 0;
}

```