#include <bits/stdc++.h>
using namespace std;
const int maxn = 100500;
const int inf = 2e9;
const double eps = 1e-8;
const int base = 1073676287;
long long dp[64][2] = {0LL};
int a[64] = {0}, b[64] = {0};
bool valid(int j, int c1, int c2, int fl) {
  if ((c1 + c2 + fl) % 2 == a[j] && (c1 ^ c2) == b[j]) return 1;
  return 0;
}
int main() {
  srand(time(0));
  long long second, x;
  cin >> second >> x;
  long long s1 = second, x1 = x;
  int pos = 0;
  while (second) {
    a[pos++] = second % 2LL;
    second /= 2LL;
  }
  int cur = pos;
  pos = 0;
  while (x) {
    b[pos++] = x % 2LL;
    x /= 2LL;
  }
  if (valid(0, 0, 0, 0)) dp[1][0] += 1LL;
  if (valid(0, 1, 0, 0)) dp[1][0] += 1LL;
  if (valid(0, 0, 1, 0)) dp[1][0] += 1LL;
  if (valid(0, 1, 1, 0)) dp[1][1] += 1LL;
  for (int j = 1; j < 50; j++)
    for (int c1 = 0; c1 < 2; c1++)
      for (int c2 = 0; c2 < 2; c2++)
        for (int fl = 0; fl < 2; fl++) {
          if (valid(j, c1, c2, fl)) dp[j + 1][(c1 + c2 + fl) / 2] += dp[j][fl];
        }
  long long ans = dp[50][0];
  if (s1 == x1) ans -= 2LL;
  cout << ans;
  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;
const int maxn = 100500;
const int inf = 2e9;
const double eps = 1e-8;
const int base = 1073676287;
long long dp[64][2] = {0LL};
int a[64] = {0}, b[64] = {0};
bool valid(int j, int c1, int c2, int fl) {
  if ((c1 + c2 + fl) % 2 == a[j] && (c1 ^ c2) == b[j]) return 1;
  return 0;
}
int main() {
  srand(time(0));
  long long second, x;
  cin >> second >> x;
  long long s1 = second, x1 = x;
  int pos = 0;
  while (second) {
    a[pos++] = second % 2LL;
    second /= 2LL;
  }
  int cur = pos;
  pos = 0;
  while (x) {
    b[pos++] = x % 2LL;
    x /= 2LL;
  }
  if (valid(0, 0, 0, 0)) dp[1][0] += 1LL;
  if (valid(0, 1, 0, 0)) dp[1][0] += 1LL;
  if (valid(0, 0, 1, 0)) dp[1][0] += 1LL;
  if (valid(0, 1, 1, 0)) dp[1][1] += 1LL;
  for (int j = 1; j < 50; j++)
    for (int c1 = 0; c1 < 2; c1++)
      for (int c2 = 0; c2 < 2; c2++)
        for (int fl = 0; fl < 2; fl++) {
          if (valid(j, c1, c2, fl)) dp[j + 1][(c1 + c2 + fl) / 2] += dp[j][fl];
        }
  long long ans = dp[50][0];
  if (s1 == x1) ans -= 2LL;
  cout << ans;
  return 0;
}

```