#include <bits/stdc++.h>
using namespace std;
const long long mxn = 43;
long long pw[mxn + 1];
void prepare() {
  pw[0] = 1;
  for (long long i = 1; i <= mxn; ++i) {
    pw[i] = pw[i - 1] * 2;
  }
}
inline bool getbit(long long a, long long pos) { return a & pw[pos]; }
void solve() {
  prepare();
  long long s, x;
  cin >> s >> x;
  vector<vector<long long> > dp(mxn + 1, vector<long long>(2));
  for (long long p1 = 0; p1 <= 1; ++p1) {
    for (long long p2 = 0; p2 <= 1; ++p2) {
      long long sm = p1 + p2;
      long long xr = p1 ^ p2;
      if (sm % 2 != getbit(s, 0) || xr != getbit(x, 0)) continue;
      dp[1][sm / 2] += 1;
    }
  }
  for (long long i = 2; i <= mxn; ++i) {
    long long vals = getbit(s, i - 1);
    long long valx = getbit(x, i - 1);
    for (long long j = 0; j <= 1; ++j) {
      for (long long pr = 0; pr <= 1; ++pr) {
        for (long long p1 = 0; p1 <= 1; ++p1) {
          for (long long p2 = 0; p2 <= 1; ++p2) {
            long long sm = pr + p1 + p2;
            long long xr = p1 ^ p2;
            if ((sm % 2 != vals) || (xr != valx) || (sm / 2 != j)) continue;
            dp[i][j] += dp[i - 1][pr];
          }
        }
      }
    }
  }
  if (s == x) dp[mxn][0] -= 2;
  cout << dp[mxn][0] << "\n";
}
signed main() {
  srand(time(0));
  cout << fixed;
  cout << setprecision(5);
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  for (long long i = 0; i < t; ++i) {
    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;
const long long mxn = 43;
long long pw[mxn + 1];
void prepare() {
  pw[0] = 1;
  for (long long i = 1; i <= mxn; ++i) {
    pw[i] = pw[i - 1] * 2;
  }
}
inline bool getbit(long long a, long long pos) { return a & pw[pos]; }
void solve() {
  prepare();
  long long s, x;
  cin >> s >> x;
  vector<vector<long long> > dp(mxn + 1, vector<long long>(2));
  for (long long p1 = 0; p1 <= 1; ++p1) {
    for (long long p2 = 0; p2 <= 1; ++p2) {
      long long sm = p1 + p2;
      long long xr = p1 ^ p2;
      if (sm % 2 != getbit(s, 0) || xr != getbit(x, 0)) continue;
      dp[1][sm / 2] += 1;
    }
  }
  for (long long i = 2; i <= mxn; ++i) {
    long long vals = getbit(s, i - 1);
    long long valx = getbit(x, i - 1);
    for (long long j = 0; j <= 1; ++j) {
      for (long long pr = 0; pr <= 1; ++pr) {
        for (long long p1 = 0; p1 <= 1; ++p1) {
          for (long long p2 = 0; p2 <= 1; ++p2) {
            long long sm = pr + p1 + p2;
            long long xr = p1 ^ p2;
            if ((sm % 2 != vals) || (xr != valx) || (sm / 2 != j)) continue;
            dp[i][j] += dp[i - 1][pr];
          }
        }
      }
    }
  }
  if (s == x) dp[mxn][0] -= 2;
  cout << dp[mxn][0] << "\n";
}
signed main() {
  srand(time(0));
  cout << fixed;
  cout << setprecision(5);
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  for (long long i = 0; i < t; ++i) {
    solve();
  }
}

```