#include <bits/stdc++.h>
using namespace std;
long long sum, xo, k1, k2, p, ras, ok, aux, t, a[100], b[100], s[100];
int main() {
  scanf("%I64d %I64d", &sum, &xo);
  aux = sum;
  while (aux > 0) {
    k1++;
    a[k1] = aux % 2;
    aux /= 2;
  }
  aux = xo;
  p = 1;
  while (aux > 0) {
    k2++;
    b[k2] = aux % 2;
    if (b[k2] == 1) p = p * 2;
    aux /= 2;
  }
  if (a[1] + b[1] == 1)
    ras = 0;
  else if (sum < xo)
    ras = 0;
  else if (sum == xo)
    ras = p - 2;
  else {
    if (a[1] == 0)
      s[1] = 0;
    else
      s[1] = 1;
    ok = 1;
    ras = p;
    for (int i = 2; i <= k1 && ok == 1; i++) {
      if (t == 0) {
        if (a[i] == 0) {
          if (b[i] == 0)
            s[i] = 0;
          else {
            s[i] = 1;
            if (s[i - 1] == 0) {
              s[i - 1] = 2;
              t = 1;
            } else
              ok = 0;
          }
        } else {
          if (b[i] == 1)
            s[i] = 1;
          else {
            if (s[i - 1] == 0)
              s[i - 1] = 2;
            else
              ok = 0;
          }
        }
      } else {
        t = 0;
        if (a[i] == 1) {
          if (b[i] == 0)
            s[i] = 0;
          else
            ok = 0;
        } else {
          if (b[i] == 1) {
            s[i] = 1;
            t = 1;
          } else
            ok = 0;
        }
      }
    }
    if (ok == 0) ras = 0;
  }
  printf("%I64d", ras);
  return 0;
}

### 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;
long long sum, xo, k1, k2, p, ras, ok, aux, t, a[100], b[100], s[100];
int main() {
  scanf("%I64d %I64d", &sum, &xo);
  aux = sum;
  while (aux > 0) {
    k1++;
    a[k1] = aux % 2;
    aux /= 2;
  }
  aux = xo;
  p = 1;
  while (aux > 0) {
    k2++;
    b[k2] = aux % 2;
    if (b[k2] == 1) p = p * 2;
    aux /= 2;
  }
  if (a[1] + b[1] == 1)
    ras = 0;
  else if (sum < xo)
    ras = 0;
  else if (sum == xo)
    ras = p - 2;
  else {
    if (a[1] == 0)
      s[1] = 0;
    else
      s[1] = 1;
    ok = 1;
    ras = p;
    for (int i = 2; i <= k1 && ok == 1; i++) {
      if (t == 0) {
        if (a[i] == 0) {
          if (b[i] == 0)
            s[i] = 0;
          else {
            s[i] = 1;
            if (s[i - 1] == 0) {
              s[i - 1] = 2;
              t = 1;
            } else
              ok = 0;
          }
        } else {
          if (b[i] == 1)
            s[i] = 1;
          else {
            if (s[i - 1] == 0)
              s[i - 1] = 2;
            else
              ok = 0;
          }
        }
      } else {
        t = 0;
        if (a[i] == 1) {
          if (b[i] == 0)
            s[i] = 0;
          else
            ok = 0;
        } else {
          if (b[i] == 1) {
            s[i] = 1;
            t = 1;
          } else
            ok = 0;
        }
      }
    }
    if (ok == 0) ras = 0;
  }
  printf("%I64d", ras);
  return 0;
}

```