#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using tpl = tuple<int, int, int>;
using pcc = pair<char, char>;
const ll inf = 1e18 + 100;
const ll mod = 1e9 + 7;
int dr[] = {-1, 0, 1, 0};
int dc[] = {0, 1, 0, -1};
int kr[] = {-1, 1, -2, -2, -1, 1, 2, 2};
int kc[] = {-2, -2, -1, 1, 2, 2, -1, 1};
int dgr[] = {-1, -1, 1, 1};
int dgc[] = {1, -1, -1, 1};
const int N = 50;
int sum[55], jor[55];
ll dp[55][4];
ll fun(int idx, int rem) {
  if (idx == N) return rem == 0;
  ll &mami = dp[idx][rem];
  if (mami != -1) return mami;
  ll ans = 0;
  int s = sum[idx];
  int x = jor[idx];
  for (int a = 0; a < 2; a++) {
    for (int b = 0; b < 2; b++) {
      int cur_x = a ^ b;
      int cur_s = (rem xor a xor b);
      int carry = (rem + a + b) / 2;
      if (s == cur_s and x == cur_x) ans += fun(idx + 1, carry);
    }
  }
  return mami = ans;
}
void solve() {
  ll s, x;
  cin >> s >> x;
  int idx = 0;
  bool ok = s == x;
  while (x) {
    jor[idx] = x % 2;
    x /= 2;
    idx++;
  }
  idx = 0;
  while (s) {
    sum[idx] = s % 2;
    s /= 2;
    idx++;
  }
  memset(dp, -1, sizeof dp);
  cout << fun(0, 0) - 2 * ok << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tt = 1;
  while (tt--) {
    solve();
  }
  return 0;
}

### Prompt

Your challenge is to write a cpp solution 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 ll = long long;
using pii = pair<int, int>;
using tpl = tuple<int, int, int>;
using pcc = pair<char, char>;
const ll inf = 1e18 + 100;
const ll mod = 1e9 + 7;
int dr[] = {-1, 0, 1, 0};
int dc[] = {0, 1, 0, -1};
int kr[] = {-1, 1, -2, -2, -1, 1, 2, 2};
int kc[] = {-2, -2, -1, 1, 2, 2, -1, 1};
int dgr[] = {-1, -1, 1, 1};
int dgc[] = {1, -1, -1, 1};
const int N = 50;
int sum[55], jor[55];
ll dp[55][4];
ll fun(int idx, int rem) {
  if (idx == N) return rem == 0;
  ll &mami = dp[idx][rem];
  if (mami != -1) return mami;
  ll ans = 0;
  int s = sum[idx];
  int x = jor[idx];
  for (int a = 0; a < 2; a++) {
    for (int b = 0; b < 2; b++) {
      int cur_x = a ^ b;
      int cur_s = (rem xor a xor b);
      int carry = (rem + a + b) / 2;
      if (s == cur_s and x == cur_x) ans += fun(idx + 1, carry);
    }
  }
  return mami = ans;
}
void solve() {
  ll s, x;
  cin >> s >> x;
  int idx = 0;
  bool ok = s == x;
  while (x) {
    jor[idx] = x % 2;
    x /= 2;
    idx++;
  }
  idx = 0;
  while (s) {
    sum[idx] = s % 2;
    s /= 2;
    idx++;
  }
  memset(dp, -1, sizeof dp);
  cout << fun(0, 0) - 2 * ok << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tt = 1;
  while (tt--) {
    solve();
  }
  return 0;
}

```