#include <bits/stdc++.h>
using namespace std;
long long int MOD(long long int a, long long int b) {
  if (a > b)
    return a - b;
  else
    return b - a;
}
int max3(int a, int b, int c) { return max(c, max(a, b)); }
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long int logg(long long int a) {
  long long int x = 0;
  while (a > 1) {
    x++;
    a /= 2;
  }
  return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int second, n, r, o;
  cin >> second >> n;
  r = n;
  o = second;
  vector<long long int> S, N;
  while (second > 0) {
    S.push_back(second % 2);
    second /= 2;
  }
  while (n > 0) {
    N.push_back(n % 2);
    n /= 2;
  }
  if (N.size() < S.size()) {
    while (N.size() != S.size()) N.push_back(0);
  } else if (S.size() < N.size()) {
    while (N.size() != S.size()) S.push_back(0);
  }
  vector<long long int> A[2];
  A[0].resize(N.size());
  A[1].resize(N.size());
  A[0][0] = 0;
  A[1][0] = 0;
  if (S[0] == 0) {
    if (N[0] == 0) {
      A[0][0] = 1;
      A[1][0] = 1;
    }
  } else {
    if (N[0] == 1) {
      A[0][0] = 2;
      A[1][0] = 0;
    }
  }
  for (int i = 1; i < N.size(); i++) {
    if (S[i] == 0) {
      if (N[i] == 0) {
        A[1][i] = A[0][i - 1];
        A[0][i] = A[0][i - 1];
      } else {
        A[1][i] = 2 * A[1][i - 1];
        A[0][i] = 0;
      }
    } else {
      if (N[i] == 0) {
        A[0][i] = A[1][i - 1];
        A[1][i] = A[1][i - 1];
      } else {
        A[0][i] = 2 * A[0][i - 1];
        A[1][i] = 0;
      }
    }
  }
  int t = 0;
  if (r == o) t = 1;
  cout << A[0][N.size() - 1] - 2 * t;
}

### Prompt

Your task is to create 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;
long long int MOD(long long int a, long long int b) {
  if (a > b)
    return a - b;
  else
    return b - a;
}
int max3(int a, int b, int c) { return max(c, max(a, b)); }
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long int logg(long long int a) {
  long long int x = 0;
  while (a > 1) {
    x++;
    a /= 2;
  }
  return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int second, n, r, o;
  cin >> second >> n;
  r = n;
  o = second;
  vector<long long int> S, N;
  while (second > 0) {
    S.push_back(second % 2);
    second /= 2;
  }
  while (n > 0) {
    N.push_back(n % 2);
    n /= 2;
  }
  if (N.size() < S.size()) {
    while (N.size() != S.size()) N.push_back(0);
  } else if (S.size() < N.size()) {
    while (N.size() != S.size()) S.push_back(0);
  }
  vector<long long int> A[2];
  A[0].resize(N.size());
  A[1].resize(N.size());
  A[0][0] = 0;
  A[1][0] = 0;
  if (S[0] == 0) {
    if (N[0] == 0) {
      A[0][0] = 1;
      A[1][0] = 1;
    }
  } else {
    if (N[0] == 1) {
      A[0][0] = 2;
      A[1][0] = 0;
    }
  }
  for (int i = 1; i < N.size(); i++) {
    if (S[i] == 0) {
      if (N[i] == 0) {
        A[1][i] = A[0][i - 1];
        A[0][i] = A[0][i - 1];
      } else {
        A[1][i] = 2 * A[1][i - 1];
        A[0][i] = 0;
      }
    } else {
      if (N[i] == 0) {
        A[0][i] = A[1][i - 1];
        A[1][i] = A[1][i - 1];
      } else {
        A[0][i] = 2 * A[0][i - 1];
        A[1][i] = 0;
      }
    }
  }
  int t = 0;
  if (r == o) t = 1;
  cout << A[0][N.size() - 1] - 2 * t;
}

```