#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b) {
  long long rs = 1, cr = a;
  while (b) {
    if (b & 1) rs = (rs * cr) % 1000000007;
    cr = (cr * cr) % 1000000007;
    b >>= 1;
  }
  return rs;
}
void solve() {
  long long s, x;
  scanf("%lld", &s);
  scanf("%lld", &x);
  long long cr = 1;
  long long sm = 0;
  long long rs = 1;
  long long tx = x;
  while (x) {
    if (x & 1) rs <<= 1;
    cr = (cr << 1);
    x >>= 1;
  }
  sm = s - tx;
  if (sm < 0) {
    printf("0\n");
    return;
  }
  if (sm == 0) rs -= 2;
  long long tsm = 0;
  cr = 2;
  while (cr < 10000000000000000ll) {
    if (!(tx & 1)) tsm += cr;
    cr <<= 1;
    tx >>= 1;
  }
  if ((sm & tsm) != sm) rs = 0;
  printf("%lld\n", rs);
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
}

### Prompt

Please create a solution in cpp 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 power(long long a, long long b) {
  long long rs = 1, cr = a;
  while (b) {
    if (b & 1) rs = (rs * cr) % 1000000007;
    cr = (cr * cr) % 1000000007;
    b >>= 1;
  }
  return rs;
}
void solve() {
  long long s, x;
  scanf("%lld", &s);
  scanf("%lld", &x);
  long long cr = 1;
  long long sm = 0;
  long long rs = 1;
  long long tx = x;
  while (x) {
    if (x & 1) rs <<= 1;
    cr = (cr << 1);
    x >>= 1;
  }
  sm = s - tx;
  if (sm < 0) {
    printf("0\n");
    return;
  }
  if (sm == 0) rs -= 2;
  long long tsm = 0;
  cr = 2;
  while (cr < 10000000000000000ll) {
    if (!(tx & 1)) tsm += cr;
    cr <<= 1;
    tx >>= 1;
  }
  if ((sm & tsm) != sm) rs = 0;
  printf("%lld\n", rs);
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
}

```