#include <bits/stdc++.h>
using namespace std;
const long long OO = 1e9;
const long long OOL = 1e18;
const long long MODi = 1e9 + 7;
const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
const int N = 100;
vector<int> prime;
bool mat[1000001] = {0};
void generate_primes(int n) {
  prime.clear();
  prime.push_back(2);
  for (int i = 3; i * i <= n; i += 2) {
    if (mat[i] == 0) {
      for (int j = i * i; j < n; j += 2 * i) mat[j] = 1;
    }
  }
  for (int i = 3; i <= n; i += 2)
    if (!mat[i]) prime.push_back(i);
}
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  return (b == 0 ? a : gcd(b, a % b));
}
unsigned long long lcm(unsigned long long a, unsigned long long b) {
  return (a * (b / gcd(a, b)));
}
unsigned long long power(unsigned long long a, unsigned long long b) {
  if (b == 0) return 1;
  if (b == 1) return a;
  unsigned long long ans = power(a, b / 2);
  ans = ans * ans;
  if (b % 2 != 0) ans *= a;
  return ans;
}
long long memo[50][2][2][2];
int s[50] = {0}, x[50] = {0};
long long dp(int cur, int carry, int zerofirst, int zerosecond) {
  if (cur == 50) {
    if (!zerofirst && !zerosecond && carry == 0) return 1;
    return 0;
  }
  long long &ret = memo[cur][carry][zerofirst][zerosecond];
  if (ret != -1) return ret;
  if (x[cur] == 1) {
    long long cnt = 0;
    if (s[cur] == 1) {
      if (carry == 0) {
        cnt += dp(cur + 1, 0, zerofirst, 0);
        cnt += dp(cur + 1, 0, 0, zerosecond);
      }
      return ret = cnt;
    } else {
      if (carry == 1) {
        cnt += dp(cur + 1, 1, zerofirst, 0);
        cnt += dp(cur + 1, 1, 0, zerosecond);
      }
      return ret = cnt;
    }
  } else {
    long long cnt = 0;
    if (s[cur] == 1) {
      if (carry == 1) {
        cnt += dp(cur + 1, 0, zerofirst, zerosecond);
        cnt += dp(cur + 1, 1, 0, 0);
      }
      return ret = cnt;
    } else {
      if (carry == 0) {
        cnt += dp(cur + 1, 1, 0, 0);
        cnt += dp(cur + 1, 0, zerofirst, zerosecond);
      }
      return ret = cnt;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  memset(memo, -1, sizeof(memo));
  long long xx, ss;
  cin >> ss >> xx;
  int idx = 0;
  while (xx) x[idx++] = xx % 2, xx /= 2;
  idx = 0;
  while (ss) s[idx++] = ss % 2, ss /= 2;
  cout << dp(0, 0, 1, 1) << endl;
  return 0;
}

### Prompt

Construct a CPP code solution to the problem outlined:

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 OO = 1e9;
const long long OOL = 1e18;
const long long MODi = 1e9 + 7;
const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
const int N = 100;
vector<int> prime;
bool mat[1000001] = {0};
void generate_primes(int n) {
  prime.clear();
  prime.push_back(2);
  for (int i = 3; i * i <= n; i += 2) {
    if (mat[i] == 0) {
      for (int j = i * i; j < n; j += 2 * i) mat[j] = 1;
    }
  }
  for (int i = 3; i <= n; i += 2)
    if (!mat[i]) prime.push_back(i);
}
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  return (b == 0 ? a : gcd(b, a % b));
}
unsigned long long lcm(unsigned long long a, unsigned long long b) {
  return (a * (b / gcd(a, b)));
}
unsigned long long power(unsigned long long a, unsigned long long b) {
  if (b == 0) return 1;
  if (b == 1) return a;
  unsigned long long ans = power(a, b / 2);
  ans = ans * ans;
  if (b % 2 != 0) ans *= a;
  return ans;
}
long long memo[50][2][2][2];
int s[50] = {0}, x[50] = {0};
long long dp(int cur, int carry, int zerofirst, int zerosecond) {
  if (cur == 50) {
    if (!zerofirst && !zerosecond && carry == 0) return 1;
    return 0;
  }
  long long &ret = memo[cur][carry][zerofirst][zerosecond];
  if (ret != -1) return ret;
  if (x[cur] == 1) {
    long long cnt = 0;
    if (s[cur] == 1) {
      if (carry == 0) {
        cnt += dp(cur + 1, 0, zerofirst, 0);
        cnt += dp(cur + 1, 0, 0, zerosecond);
      }
      return ret = cnt;
    } else {
      if (carry == 1) {
        cnt += dp(cur + 1, 1, zerofirst, 0);
        cnt += dp(cur + 1, 1, 0, zerosecond);
      }
      return ret = cnt;
    }
  } else {
    long long cnt = 0;
    if (s[cur] == 1) {
      if (carry == 1) {
        cnt += dp(cur + 1, 0, zerofirst, zerosecond);
        cnt += dp(cur + 1, 1, 0, 0);
      }
      return ret = cnt;
    } else {
      if (carry == 0) {
        cnt += dp(cur + 1, 1, 0, 0);
        cnt += dp(cur + 1, 0, zerofirst, zerosecond);
      }
      return ret = cnt;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  memset(memo, -1, sizeof(memo));
  long long xx, ss;
  cin >> ss >> xx;
  int idx = 0;
  while (xx) x[idx++] = xx % 2, xx /= 2;
  idx = 0;
  while (ss) s[idx++] = ss % 2, ss /= 2;
  cout << dp(0, 0, 1, 1) << endl;
  return 0;
}

```