#include <bits/stdc++.h>
long long ans, s, x;
int max, k, n1, n2, i, j, a[100], b[100], c[100];
int main(int argc, char *argv[]) {
  scanf("%I64d%I64d", &s, &x);
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  memset(c, 0, sizeof(c));
  n1 = 0;
  n2 = 0;
  while (s != 0) {
    a[n1] = s % 2;
    s = s / 2;
    n1++;
  }
  while (x != 0) {
    b[n2] = x % 2;
    x = x / 2;
    n2++;
  }
  j = 0;
  k = 0;
  ans = 1;
  while (j <= n1 || j <= n2) {
    if (k == 0) {
      if (b[j] != a[j]) {
        ans = 0;
        break;
      }
      if (b[j] == 1) {
        c[j] = 2;
        k = 0;
      }
      if (b[j] == 0) {
        if (a[j + 1] == b[j + 1]) {
          c[j] = 0;
          k = 0;
        } else {
          c[j] = 1;
          k = 1;
        }
      }
    } else {
      if (b[j] == a[j]) {
        ans = 0;
        break;
      }
      if (b[j] == 1) {
        c[j] = 2;
        k = 1;
      }
      if (b[j] == 0) {
        if (a[j + 1] == b[j + 1]) {
          c[j] = 0;
          k = 0;
        } else {
          c[j] = 1;
          k = 1;
        }
      }
    }
    j++;
  }
  if (ans == 0)
    printf("%I64d\n", ans);
  else {
    i = 0;
    j = 0;
    while (j <= n1 || j <= n2) {
      if (c[j] == 2) ans *= 2;
      if (c[j] == 1) i = 1;
      j++;
    }
    if (i == 0 && ans >= 2) ans = ans - 2;
    printf("%I64d\n", ans);
  }
  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>
long long ans, s, x;
int max, k, n1, n2, i, j, a[100], b[100], c[100];
int main(int argc, char *argv[]) {
  scanf("%I64d%I64d", &s, &x);
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  memset(c, 0, sizeof(c));
  n1 = 0;
  n2 = 0;
  while (s != 0) {
    a[n1] = s % 2;
    s = s / 2;
    n1++;
  }
  while (x != 0) {
    b[n2] = x % 2;
    x = x / 2;
    n2++;
  }
  j = 0;
  k = 0;
  ans = 1;
  while (j <= n1 || j <= n2) {
    if (k == 0) {
      if (b[j] != a[j]) {
        ans = 0;
        break;
      }
      if (b[j] == 1) {
        c[j] = 2;
        k = 0;
      }
      if (b[j] == 0) {
        if (a[j + 1] == b[j + 1]) {
          c[j] = 0;
          k = 0;
        } else {
          c[j] = 1;
          k = 1;
        }
      }
    } else {
      if (b[j] == a[j]) {
        ans = 0;
        break;
      }
      if (b[j] == 1) {
        c[j] = 2;
        k = 1;
      }
      if (b[j] == 0) {
        if (a[j + 1] == b[j + 1]) {
          c[j] = 0;
          k = 0;
        } else {
          c[j] = 1;
          k = 1;
        }
      }
    }
    j++;
  }
  if (ans == 0)
    printf("%I64d\n", ans);
  else {
    i = 0;
    j = 0;
    while (j <= n1 || j <= n2) {
      if (c[j] == 2) ans *= 2;
      if (c[j] == 1) i = 1;
      j++;
    }
    if (i == 0 && ans >= 2) ans = ans - 2;
    printf("%I64d\n", ans);
  }
  return 0;
}

```