#include <bits/stdc++.h>
using namespace std;
long long s, x;
string S, X;
long long dp[64][2];
long long d__p(int i, int st) {
  if (i == S.size() && st)
    return 0;
  else if (i == S.size())
    return 1;
  long long &res = dp[i][st];
  if (res != -1) return res;
  res = 0;
  int x = S[i] - '0';
  int y = X[i] - '0';
  for (int a = 0; a <= 1; a++) {
    for (int b = 0; b <= 1; b++) {
      int remember = (a + b + st) > 1;
      int Sum = a + b + st;
      Sum %= 2;
      int Xor = a ^ b;
      if (Sum != x || Xor != y) continue;
      res += d__p(i + 1, remember);
    }
  }
  return res;
}
int main() {
  cin >> s >> x;
  for (int i = 63; i >= 0; i--) {
    if (s & (1LL << i))
      S += '1';
    else
      S += '0';
    if (x & (1LL << i))
      X += '1';
    else
      X += '0';
  }
  reverse(S.begin(), S.end());
  reverse(X.begin(), X.end());
  memset(dp, -1, sizeof dp);
  cout << d__p(0, 0) - 2 * (s == x);
  return 0;
}

### Prompt

Please provide a CPP coded solution 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;
long long s, x;
string S, X;
long long dp[64][2];
long long d__p(int i, int st) {
  if (i == S.size() && st)
    return 0;
  else if (i == S.size())
    return 1;
  long long &res = dp[i][st];
  if (res != -1) return res;
  res = 0;
  int x = S[i] - '0';
  int y = X[i] - '0';
  for (int a = 0; a <= 1; a++) {
    for (int b = 0; b <= 1; b++) {
      int remember = (a + b + st) > 1;
      int Sum = a + b + st;
      Sum %= 2;
      int Xor = a ^ b;
      if (Sum != x || Xor != y) continue;
      res += d__p(i + 1, remember);
    }
  }
  return res;
}
int main() {
  cin >> s >> x;
  for (int i = 63; i >= 0; i--) {
    if (s & (1LL << i))
      S += '1';
    else
      S += '0';
    if (x & (1LL << i))
      X += '1';
    else
      X += '0';
  }
  reverse(S.begin(), S.end());
  reverse(X.begin(), X.end());
  memset(dp, -1, sizeof dp);
  cout << d__p(0, 0) - 2 * (s == x);
  return 0;
}

```