#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using f64 = double;
using f80 = long double;
using pii = pair<int, int>;
using pll = pair<i64, i64>;
using ptx = pair<f64, f64>;
i64 sum, xsum, ant;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  i64 tsum, a(0), b(0);
  cin >> sum >> xsum;
  ant = 1;
  tsum = sum;
  for (int lg = 40; lg >= 0; --lg) {
    i64 add = 1LL << lg;
    if (~xsum & (1LL << lg)) {
      add *= 2;
      if (tsum - add >= 0) {
        a += add / 2;
        b += add / 2;
        tsum -= add;
      }
    } else {
      ant *= 2;
      if (tsum - add >= 0) {
        a += add;
        tsum -= add;
      }
    }
  }
  if (b == 0) ant -= 2;
  if (a + b == sum && (a ^ b) == xsum)
    cout << ant << endl;
  else
    cout << 0 << endl;
  return 0;
}

### Prompt

Create a solution in Cpp for 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;
using i64 = long long;
using f64 = double;
using f80 = long double;
using pii = pair<int, int>;
using pll = pair<i64, i64>;
using ptx = pair<f64, f64>;
i64 sum, xsum, ant;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  i64 tsum, a(0), b(0);
  cin >> sum >> xsum;
  ant = 1;
  tsum = sum;
  for (int lg = 40; lg >= 0; --lg) {
    i64 add = 1LL << lg;
    if (~xsum & (1LL << lg)) {
      add *= 2;
      if (tsum - add >= 0) {
        a += add / 2;
        b += add / 2;
        tsum -= add;
      }
    } else {
      ant *= 2;
      if (tsum - add >= 0) {
        a += add;
        tsum -= add;
      }
    }
  }
  if (b == 0) ant -= 2;
  if (a + b == sum && (a ^ b) == xsum)
    cout << ant << endl;
  else
    cout << 0 << endl;
  return 0;
}

```