#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long s, x;
long long dp[100][3];
long long last;
long long func(long long n, long long carry) {
  if (n == 63) {
    if (carry == 0) return 1;
    return 0;
  }
  if (dp[n][carry] != -1) return dp[n][carry];
  long long op1 = 1;
  long long ss = 0, xx = 0;
  if ((1LL << n) & s) ss = 1;
  if ((1LL << n) & x) xx = 1;
  if (carry == 0) {
    if (ss == 0 && xx == 0) op1 = func(n + 1, 1) + func(n + 1, 0);
    if (ss == 0 && xx == 1) op1 = 0;
    if (ss == 1 && xx == 0) op1 = 0;
    if (ss == 1 && xx == 1) op1 = 2 * func(n + 1, 0);
  } else {
    if (ss == 0 && xx == 0) op1 = 0;
    if (ss == 0 && xx == 1) op1 = 2 * func(n + 1, 1);
    if (ss == 1 && xx == 0) op1 = func(n + 1, 0) + func(n + 1, 1);
    if (ss == 1 && xx == 1) op1 = 0;
  }
  return dp[n][carry] = op1;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin >> s >> x;
  if (x == 0) {
    if (s & 1)
      cout << 0;
    else
      cout << 1;
    return 0;
  }
  for (long long i = 63; i >= 0; --i) {
    if ((1LL << i) & s) {
      last = i;
      break;
    }
  }
  memset(dp, -1, sizeof dp);
  long long ans = func(0, 0);
  if (s == x)
    cout << ans - 2;
  else
    cout << ans;
}

### 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;
long long mod = 1000000007;
long long s, x;
long long dp[100][3];
long long last;
long long func(long long n, long long carry) {
  if (n == 63) {
    if (carry == 0) return 1;
    return 0;
  }
  if (dp[n][carry] != -1) return dp[n][carry];
  long long op1 = 1;
  long long ss = 0, xx = 0;
  if ((1LL << n) & s) ss = 1;
  if ((1LL << n) & x) xx = 1;
  if (carry == 0) {
    if (ss == 0 && xx == 0) op1 = func(n + 1, 1) + func(n + 1, 0);
    if (ss == 0 && xx == 1) op1 = 0;
    if (ss == 1 && xx == 0) op1 = 0;
    if (ss == 1 && xx == 1) op1 = 2 * func(n + 1, 0);
  } else {
    if (ss == 0 && xx == 0) op1 = 0;
    if (ss == 0 && xx == 1) op1 = 2 * func(n + 1, 1);
    if (ss == 1 && xx == 0) op1 = func(n + 1, 0) + func(n + 1, 1);
    if (ss == 1 && xx == 1) op1 = 0;
  }
  return dp[n][carry] = op1;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin >> s >> x;
  if (x == 0) {
    if (s & 1)
      cout << 0;
    else
      cout << 1;
    return 0;
  }
  for (long long i = 63; i >= 0; --i) {
    if ((1LL << i) & s) {
      last = i;
      break;
    }
  }
  memset(dp, -1, sizeof dp);
  long long ans = func(0, 0);
  if (s == x)
    cout << ans - 2;
  else
    cout << ans;
}

```