#include <bits/stdc++.h>
using namespace std;
const long long UNDEF = -1;
template <typename T>
inline bool chkmax(T &a, T b) {
  return a < b ? a = b, true : false;
}
template <typename T>
inline bool chkmin(T &a, T b) {
  return a > b ? a = b, true : false;
}
const long long MAXN = 64;
long long f[MAXN][2][4];
int main() {
  ios_base::sync_with_stdio(false);
  long long s, t;
  cin >> s >> t;
  long long n = 60;
  for (long long i = 0; i <= n; i++) {
    for (long long k = 0; k < 2; k++) {
      for (long long z = 0; z < 4; z++) {
        f[i][k][0] = 0;
      }
    }
  }
  f[0][0][0] = 1;
  for (long long i = 1; i <= n; i++) {
    long long sum = (s >> (i - 1)) & 1;
    long long xo = (t >> (i - 1)) & 1;
    for (long long c = 0; c < 2; c++) {
      for (long long a = 0; a < 2; a++) {
        for (long long b = 0; b < 2; b++) {
          long long r = (a + b + c > 1) ? 1 : 0;
          if (((a ^ b) == xo) && ((a + b + c) % 2 == sum)) {
            for (long long z = 0; z < 4; z++) {
              long long nz = z;
              if (a != 0) nz |= 1;
              if (b != 0) nz |= 2;
              f[i][r][nz] += f[i - 1][c][z];
            }
          }
        }
      }
    }
  }
  long long ans = f[n][0][3];
  cout << ans << "\n";
}

### 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;
const long long UNDEF = -1;
template <typename T>
inline bool chkmax(T &a, T b) {
  return a < b ? a = b, true : false;
}
template <typename T>
inline bool chkmin(T &a, T b) {
  return a > b ? a = b, true : false;
}
const long long MAXN = 64;
long long f[MAXN][2][4];
int main() {
  ios_base::sync_with_stdio(false);
  long long s, t;
  cin >> s >> t;
  long long n = 60;
  for (long long i = 0; i <= n; i++) {
    for (long long k = 0; k < 2; k++) {
      for (long long z = 0; z < 4; z++) {
        f[i][k][0] = 0;
      }
    }
  }
  f[0][0][0] = 1;
  for (long long i = 1; i <= n; i++) {
    long long sum = (s >> (i - 1)) & 1;
    long long xo = (t >> (i - 1)) & 1;
    for (long long c = 0; c < 2; c++) {
      for (long long a = 0; a < 2; a++) {
        for (long long b = 0; b < 2; b++) {
          long long r = (a + b + c > 1) ? 1 : 0;
          if (((a ^ b) == xo) && ((a + b + c) % 2 == sum)) {
            for (long long z = 0; z < 4; z++) {
              long long nz = z;
              if (a != 0) nz |= 1;
              if (b != 0) nz |= 2;
              f[i][r][nz] += f[i - 1][c][z];
            }
          }
        }
      }
    }
  }
  long long ans = f[n][0][3];
  cout << ans << "\n";
}

```