#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:167177216")
using namespace std;
const int MAX = 2147483647;
const int MAXN = 1001000;
const long long MOD = 1000000000 + 7;
vector<int> ds, dx;
long long D[50][50];
long long rec(int pos, int plus) {
  if (pos == ds.size() - 1) return plus == 0;
  long long result = 0;
  int cur_have = (dx[pos]) % 2;
  int cur_need = ds[pos];
  for (int i = 0; i < 2; ++i) {
    if (((cur_have ^ i) + plus + i) % 2 == cur_need) {
      if (D[pos + 1][((cur_have ^ i) + plus + i) / 2] == -1) {
        D[pos + 1][((cur_have ^ i) + plus + i) / 2] =
            rec(pos + 1, ((cur_have ^ i) + plus + i) / 2);
      }
      result += D[pos + 1][((cur_have ^ i) + plus + i) / 2];
    }
  }
  return result;
}
int main() {
  memset(D, -1, sizeof(D));
  long long s, x;
  cin >> s >> x;
  if (x == 0) {
    if (s % 2 == 1) {
      cout << 0;
      return 0;
    }
    cout << 1;
    return 0;
  }
  long long v = s;
  while (v > 0) {
    ds.push_back(v & 1);
    v >>= 1;
  }
  v = x;
  while (v > 0) {
    dx.push_back(v & 1);
    v >>= 1;
  }
  while (ds.size() < dx.size()) ds.push_back(0);
  while (ds.size() > dx.size()) dx.push_back(0);
  ds.push_back(0);
  dx.push_back(0);
  long long res = rec(0, 0);
  if (x == s) res -= 2;
  cout << res;
  return 0;
}

### Prompt

Generate 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>
#pragma comment(linker, "/STACK:167177216")
using namespace std;
const int MAX = 2147483647;
const int MAXN = 1001000;
const long long MOD = 1000000000 + 7;
vector<int> ds, dx;
long long D[50][50];
long long rec(int pos, int plus) {
  if (pos == ds.size() - 1) return plus == 0;
  long long result = 0;
  int cur_have = (dx[pos]) % 2;
  int cur_need = ds[pos];
  for (int i = 0; i < 2; ++i) {
    if (((cur_have ^ i) + plus + i) % 2 == cur_need) {
      if (D[pos + 1][((cur_have ^ i) + plus + i) / 2] == -1) {
        D[pos + 1][((cur_have ^ i) + plus + i) / 2] =
            rec(pos + 1, ((cur_have ^ i) + plus + i) / 2);
      }
      result += D[pos + 1][((cur_have ^ i) + plus + i) / 2];
    }
  }
  return result;
}
int main() {
  memset(D, -1, sizeof(D));
  long long s, x;
  cin >> s >> x;
  if (x == 0) {
    if (s % 2 == 1) {
      cout << 0;
      return 0;
    }
    cout << 1;
    return 0;
  }
  long long v = s;
  while (v > 0) {
    ds.push_back(v & 1);
    v >>= 1;
  }
  v = x;
  while (v > 0) {
    dx.push_back(v & 1);
    v >>= 1;
  }
  while (ds.size() < dx.size()) ds.push_back(0);
  while (ds.size() > dx.size()) dx.push_back(0);
  ds.push_back(0);
  dx.push_back(0);
  long long res = rec(0, 0);
  if (x == s) res -= 2;
  cout << res;
  return 0;
}

```