#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
int main() {
  int test_cases = 1;
  ios::sync_with_stdio(false);
  for (int test_case = (int)(0); test_case < (int)(test_cases); ++test_case) {
    long long s_, x_;
    cin >> s_ >> x_;
    int n = 64;
    vector<int> s(n + 1), x(n + 1);
    long long s__ = s_, x__ = x_;
    for (int i = (int)(1); i <= (int)(n); ++i) {
      s[i] = s__ % 2, s__ /= 2;
      x[i] = x__ % 2, x__ /= 2;
    }
    vector<vector<long long> > dp(n + 1, vector<long long>(2));
    dp[0][0] = 1;
    for (int i = (int)(1); i <= (int)(n); ++i) {
      for (int ci1 = (int)(0); ci1 <= (int)(1); ++ci1) {
        for (int ai = (int)(0); ai <= (int)(1); ++ai) {
          for (int bi = (int)(0); bi <= (int)(1); ++bi) {
            int d = ai + bi + ci1;
            int ci = 0;
            if (d > 1) ci = 1;
            d %= 2;
            if (d == s[i] && (ai ^ bi) == x[i]) dp[i][ci] += dp[i - 1][ci1];
          }
        }
      }
    }
    long long res = dp[n][0];
    if ((0 ^ s_) == x_) res -= 2;
    cout << res << endl;
  }
  return 0;
}

### 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;
using namespace std::chrono;
int main() {
  int test_cases = 1;
  ios::sync_with_stdio(false);
  for (int test_case = (int)(0); test_case < (int)(test_cases); ++test_case) {
    long long s_, x_;
    cin >> s_ >> x_;
    int n = 64;
    vector<int> s(n + 1), x(n + 1);
    long long s__ = s_, x__ = x_;
    for (int i = (int)(1); i <= (int)(n); ++i) {
      s[i] = s__ % 2, s__ /= 2;
      x[i] = x__ % 2, x__ /= 2;
    }
    vector<vector<long long> > dp(n + 1, vector<long long>(2));
    dp[0][0] = 1;
    for (int i = (int)(1); i <= (int)(n); ++i) {
      for (int ci1 = (int)(0); ci1 <= (int)(1); ++ci1) {
        for (int ai = (int)(0); ai <= (int)(1); ++ai) {
          for (int bi = (int)(0); bi <= (int)(1); ++bi) {
            int d = ai + bi + ci1;
            int ci = 0;
            if (d > 1) ci = 1;
            d %= 2;
            if (d == s[i] && (ai ^ bi) == x[i]) dp[i][ci] += dp[i - 1][ci1];
          }
        }
      }
    }
    long long res = dp[n][0];
    if ((0 ^ s_) == x_) res -= 2;
    cout << res << endl;
  }
  return 0;
}

```