#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
const int INF = (int)1e9;
const long long LINF = (long long)1e18;
const long double PI = 2 * acos((long double)0);
long long gcd(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long fpow(long long n, long long k, int p = MOD) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
template <class T>
void setmin(T& a, T val) {
  if (a > val) a = val;
}
template <class T>
void setmax(T& a, T val) {
  if (a < val) a = val;
}
void addmod(int& a, int val, int p = MOD) {
  if ((a = (a + val)) >= p) a -= p;
}
void submod(int& a, int val, int p = MOD) {
  if ((a = (a - val)) < 0) a += p;
}
int mult(int a, int b, int p = MOD) { return (long long)a * b % p; }
int inv(int a, int p = MOD) { return fpow(a, p - 2, p); }
const int maxe = 60;
long long s, x;
int a[maxe];
int b[maxe];
long long f[maxe][2];
long long calc(int pos, int r) {
  if (pos == maxe) {
    return r == 0;
  }
  long long& res = f[pos][r];
  if (~res) return res;
  res = 0;
  if (!b[pos]) {
    if (a[pos] == r) {
      res += calc(pos + 1, 0);
      res += calc(pos + 1, 1);
    }
  } else {
    if (a[pos] == (r + 1) % 2) {
      res += 2 * calc(pos + 1, (r + 1) / 2);
    }
  }
  return res;
}
void solve() {
  cin >> s >> x;
  for (int i = (0); i < (maxe); i++) {
    a[i] = (((s) >> (i)) & 1);
    b[i] = (((x) >> (i)) & 1);
  }
  memset(f, -1, sizeof(f));
  long long res = calc(0, 0);
  if (s == x) res -= 2;
  cout << res;
}
int main() {
  solve();
  return 0;
}

### Prompt

Develop a solution in CPP to the problem described below:

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 int MOD = (int)1e9 + 7;
const int INF = (int)1e9;
const long long LINF = (long long)1e18;
const long double PI = 2 * acos((long double)0);
long long gcd(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long fpow(long long n, long long k, int p = MOD) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
template <class T>
void setmin(T& a, T val) {
  if (a > val) a = val;
}
template <class T>
void setmax(T& a, T val) {
  if (a < val) a = val;
}
void addmod(int& a, int val, int p = MOD) {
  if ((a = (a + val)) >= p) a -= p;
}
void submod(int& a, int val, int p = MOD) {
  if ((a = (a - val)) < 0) a += p;
}
int mult(int a, int b, int p = MOD) { return (long long)a * b % p; }
int inv(int a, int p = MOD) { return fpow(a, p - 2, p); }
const int maxe = 60;
long long s, x;
int a[maxe];
int b[maxe];
long long f[maxe][2];
long long calc(int pos, int r) {
  if (pos == maxe) {
    return r == 0;
  }
  long long& res = f[pos][r];
  if (~res) return res;
  res = 0;
  if (!b[pos]) {
    if (a[pos] == r) {
      res += calc(pos + 1, 0);
      res += calc(pos + 1, 1);
    }
  } else {
    if (a[pos] == (r + 1) % 2) {
      res += 2 * calc(pos + 1, (r + 1) / 2);
    }
  }
  return res;
}
void solve() {
  cin >> s >> x;
  for (int i = (0); i < (maxe); i++) {
    a[i] = (((s) >> (i)) & 1);
    b[i] = (((x) >> (i)) & 1);
  }
  memset(f, -1, sizeof(f));
  long long res = calc(0, 0);
  if (s == x) res -= 2;
  cout << res;
}
int main() {
  solve();
  return 0;
}

```