#include <bits/stdc++.h>
using namespace std;
long long dp[66][2][2][2];
long long s;
long long x;
long long solve(long long i, int carry, int za, int zb) {
  if (i == 60) {
    return carry == 0 && za == 1 && zb == 1;
  }
  if (dp[i][carry][za][zb] != -1) {
    return dp[i][carry][za][zb];
  }
  long long res = 0;
  for (int j = 0; j < 2; ++j) {
    for (int k = 0; k < 2; ++k) {
      long long xx = j ^ k;
      long long ss = (j + k + carry) % 2;
      if (((x >> i) & 1) == xx && ((s >> i) & 1) == ss) {
        res +=
            solve(i + 1, (j + k + carry) / 2, (za | (j == 1)), (zb | (k == 1)));
      }
    }
  }
  return dp[i][carry][za][zb] = res;
}
int main() {
  cin >> s >> x;
  memset(dp, -1, sizeof dp);
  cout << solve(0, 0, 0, 0);
  return 0;
}

### Prompt

Create a solution in cpp for 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;
long long dp[66][2][2][2];
long long s;
long long x;
long long solve(long long i, int carry, int za, int zb) {
  if (i == 60) {
    return carry == 0 && za == 1 && zb == 1;
  }
  if (dp[i][carry][za][zb] != -1) {
    return dp[i][carry][za][zb];
  }
  long long res = 0;
  for (int j = 0; j < 2; ++j) {
    for (int k = 0; k < 2; ++k) {
      long long xx = j ^ k;
      long long ss = (j + k + carry) % 2;
      if (((x >> i) & 1) == xx && ((s >> i) & 1) == ss) {
        res +=
            solve(i + 1, (j + k + carry) / 2, (za | (j == 1)), (zb | (k == 1)));
      }
    }
  }
  return dp[i][carry][za][zb] = res;
}
int main() {
  cin >> s >> x;
  memset(dp, -1, sizeof dp);
  cout << solve(0, 0, 0, 0);
  return 0;
}

```