#include <bits/stdc++.h>
using namespace std;
const int M = 1000000007;
long long a[64], b[64], s[64], x[64], car[64];
int main() {
  long long n, i, p, q;
  cin >> p >> q;
  memset(a, -1, sizeof(a));
  memset(b, -1, sizeof(b));
  memset(car, 0, sizeof(car));
  long long k = 0;
  if ((p ^ 0) == q) k -= 2;
  for (i = 0; i < 64; i++) {
    s[i] = p % 2;
    p /= 2;
  }
  for (i = 0; i < 64; i++) {
    x[i] = q % 2;
    q /= 2;
  }
  long long A = 0;
  if (s[0] != x[0]) {
    cout << 0 << endl;
    return 0;
  }
  for (i = 0; i < 64; i++)
    if (s[i] != x[i]) {
      car[i] = 1;
    }
  for (i = 0; i < 64; i++) {
    if (x[i] == 0) {
      if (car[i + 1] == 1) {
        a[i] = 1;
        b[i] = 1;
      } else {
        a[i] = 0;
        b[i] = 0;
      }
    }
    if (x[i] == 1) {
      if (car[i] == 1) {
        if (car[i + 1] != 1) {
          cout << 0 << endl;
          return 0;
        }
        A++;
      }
      if (car[i] == 0) {
        if (car[i + 1] == 1) {
          cout << 0 << endl;
          return 0;
        }
        A++;
      }
    }
  }
  A = pow(2, A);
  A += k;
  cout << A << endl;
}

### Prompt

Develop a solution in Cpp to the problem described below:

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;
const int M = 1000000007;
long long a[64], b[64], s[64], x[64], car[64];
int main() {
  long long n, i, p, q;
  cin >> p >> q;
  memset(a, -1, sizeof(a));
  memset(b, -1, sizeof(b));
  memset(car, 0, sizeof(car));
  long long k = 0;
  if ((p ^ 0) == q) k -= 2;
  for (i = 0; i < 64; i++) {
    s[i] = p % 2;
    p /= 2;
  }
  for (i = 0; i < 64; i++) {
    x[i] = q % 2;
    q /= 2;
  }
  long long A = 0;
  if (s[0] != x[0]) {
    cout << 0 << endl;
    return 0;
  }
  for (i = 0; i < 64; i++)
    if (s[i] != x[i]) {
      car[i] = 1;
    }
  for (i = 0; i < 64; i++) {
    if (x[i] == 0) {
      if (car[i + 1] == 1) {
        a[i] = 1;
        b[i] = 1;
      } else {
        a[i] = 0;
        b[i] = 0;
      }
    }
    if (x[i] == 1) {
      if (car[i] == 1) {
        if (car[i + 1] != 1) {
          cout << 0 << endl;
          return 0;
        }
        A++;
      }
      if (car[i] == 0) {
        if (car[i + 1] == 1) {
          cout << 0 << endl;
          return 0;
        }
        A++;
      }
    }
  }
  A = pow(2, A);
  A += k;
  cout << A << endl;
}

```