#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
const int INF = 1e9 + 9;
const int B = 1e9 + 7;
const double pi = acos(-1);
ostream &operator<<(ostream &out, pair<int, int> x) {
  out << "(" << x.first << " " << x.second << ")";
  return out;
}
long long stress(long long s, long long x) {
  long long ans = 0;
  for (int i = int(1); i <= int(s - 1); ++i)
    if ((i ^ (s - i)) == x) ++ans;
  return ans;
}
long long s, x;
long long d[100], dout[100];
bool bit(long long mask, int pos) { return mask & (1ll << pos); }
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cin >> s >> x;
  if (x > s || x % 2 != s % 2) {
    cout << "0\n";
    return 0;
  }
  if (x == 0) {
    cout << (s % 2 == 0 ? 1 : 0);
    return 0;
  }
  int bs = 60, bx = 60;
  while ((1ll << bs) > s) --bs;
  while ((1ll << bx) > x) --bx;
  if (!bit(s, 0))
    d[0] = 1, dout[0] = 1;
  else
    d[0] = 2, dout[0] = 0;
  for (int i = int(1); i <= int(bs); ++i) {
    if (!bit(s, i) && !bit(x, i)) {
      d[i] = d[i - 1];
      dout[i] = d[i - 1];
    }
    if (!bit(s, i) && bit(x, i)) {
      d[i] = 0;
      dout[i] = dout[i - 1] * 2;
    }
    if (bit(s, i) && !bit(x, i)) {
      d[i] = dout[i - 1];
      dout[i] = dout[i - 1];
    }
    if (bit(s, i) && bit(x, i)) {
      d[i] = d[i - 1] * 2;
      dout[i] = 0;
    }
  }
  long long ans = (bs == bx ? d[bs] : d[bs]);
  if (x == s) ans -= 2;
  cout << ans << "\n";
  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;
const int N = 2e5;
const int INF = 1e9 + 9;
const int B = 1e9 + 7;
const double pi = acos(-1);
ostream &operator<<(ostream &out, pair<int, int> x) {
  out << "(" << x.first << " " << x.second << ")";
  return out;
}
long long stress(long long s, long long x) {
  long long ans = 0;
  for (int i = int(1); i <= int(s - 1); ++i)
    if ((i ^ (s - i)) == x) ++ans;
  return ans;
}
long long s, x;
long long d[100], dout[100];
bool bit(long long mask, int pos) { return mask & (1ll << pos); }
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cin >> s >> x;
  if (x > s || x % 2 != s % 2) {
    cout << "0\n";
    return 0;
  }
  if (x == 0) {
    cout << (s % 2 == 0 ? 1 : 0);
    return 0;
  }
  int bs = 60, bx = 60;
  while ((1ll << bs) > s) --bs;
  while ((1ll << bx) > x) --bx;
  if (!bit(s, 0))
    d[0] = 1, dout[0] = 1;
  else
    d[0] = 2, dout[0] = 0;
  for (int i = int(1); i <= int(bs); ++i) {
    if (!bit(s, i) && !bit(x, i)) {
      d[i] = d[i - 1];
      dout[i] = d[i - 1];
    }
    if (!bit(s, i) && bit(x, i)) {
      d[i] = 0;
      dout[i] = dout[i - 1] * 2;
    }
    if (bit(s, i) && !bit(x, i)) {
      d[i] = dout[i - 1];
      dout[i] = dout[i - 1];
    }
    if (bit(s, i) && bit(x, i)) {
      d[i] = d[i - 1] * 2;
      dout[i] = 0;
    }
  }
  long long ans = (bs == bx ? d[bs] : d[bs]);
  if (x == s) ans -= 2;
  cout << ans << "\n";
  return 0;
}

```