#include <bits/stdc++.h>
using namespace std;
long long int power[100010];
long long int v[100010], vd[100010];
void pre() {
  power[0] = 1;
  for (long long int i = 1; i <= 100000; i++) power[i] = power[i - 1] * 2;
}
int main(void) {
  long long int s, x, flag = 0, cnt = 0, ind = 0;
  cin >> s >> x;
  long long int temp = x;
  while (temp > 0) {
    v[ind++] = temp % 2;
    if (temp % 2 == 1) cnt++;
    temp /= 2;
  }
  pre();
  if (x == 0) {
    if (x % 2)
      cout << "0" << endl;
    else
      cout << "1" << endl;
    return 0;
  }
  if (s == x) {
    cout << power[cnt] - 2 << endl;
    return 0;
  } else if (s < x) {
    cout << "0" << endl;
    return 0;
  } else {
    long long int dif = s - x;
    temp = dif;
    if (dif % 2) {
      cout << "0" << endl;
      return 0;
    } else {
      long long int ind2 = 0;
      while (dif > 0) {
        vd[ind2++] = dif % 2;
        dif /= 2;
      }
      long long int i = 0, k = 1;
      while (1) {
        if (v[i] == 0 && vd[k] == 1) {
          temp -= power[k];
          if (temp == 0) {
            flag = 1;
            break;
          }
          if (dif < 0) break;
        } else if (v[i] == 1 && vd[k] == 1)
          break;
        i++;
        k++;
      }
      if (flag)
        cout << power[cnt] << endl;
      else
        cout << "0" << endl;
    }
  }
  return 0;
}

### Prompt

Please formulate 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 int power[100010];
long long int v[100010], vd[100010];
void pre() {
  power[0] = 1;
  for (long long int i = 1; i <= 100000; i++) power[i] = power[i - 1] * 2;
}
int main(void) {
  long long int s, x, flag = 0, cnt = 0, ind = 0;
  cin >> s >> x;
  long long int temp = x;
  while (temp > 0) {
    v[ind++] = temp % 2;
    if (temp % 2 == 1) cnt++;
    temp /= 2;
  }
  pre();
  if (x == 0) {
    if (x % 2)
      cout << "0" << endl;
    else
      cout << "1" << endl;
    return 0;
  }
  if (s == x) {
    cout << power[cnt] - 2 << endl;
    return 0;
  } else if (s < x) {
    cout << "0" << endl;
    return 0;
  } else {
    long long int dif = s - x;
    temp = dif;
    if (dif % 2) {
      cout << "0" << endl;
      return 0;
    } else {
      long long int ind2 = 0;
      while (dif > 0) {
        vd[ind2++] = dif % 2;
        dif /= 2;
      }
      long long int i = 0, k = 1;
      while (1) {
        if (v[i] == 0 && vd[k] == 1) {
          temp -= power[k];
          if (temp == 0) {
            flag = 1;
            break;
          }
          if (dif < 0) break;
        } else if (v[i] == 1 && vd[k] == 1)
          break;
        i++;
        k++;
      }
      if (flag)
        cout << power[cnt] << endl;
      else
        cout << "0" << endl;
    }
  }
  return 0;
}

```