#include <bits/stdc++.h>
using namespace std;
vector<string> _split(const string& s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return v;
}
void _print(vector<string>::iterator) {}
template <typename T, typename... Args>
void _print(vector<string>::iterator it, T a, Args... args) {
  string name = it->substr((*it)[0] == ' ', it->length());
  if (isalpha(name[0]))
    cerr << name << " = " << a << " ";
  else
    cerr << name << " ";
  _print(++it, args...);
}
const int N = 80;
long long int dp[N][2];
vector<int> read() {
  long long int a;
  scanf("%lld", &a);
  vector<int> res;
  while (a > 0) {
    res.push_back(a % 2);
    a /= 2;
  }
  while ((int)res.size() < N) {
    res.push_back(0);
  }
  return res;
}
int main() {
  vector<int> s = read();
  vector<int> x = read();
  dp[0][0] = 1;
  for (int len = 0; len < N - 1; len++) {
    for (int flag = 0; flag < 2; flag++) {
      long long int cur_val = dp[len][flag];
      if (cur_val == 0) continue;
      for (int a = 0; a < 2; a++) {
        for (int b = 0; b < 2; b++) {
          if ((a ^ b) != x[len]) continue;
          int c = a + b + flag;
          if (c % 2 != s[len]) continue;
          dp[len + 1][c / 2] += cur_val;
        }
      }
    }
  }
  long long int ans = dp[N - 1][0];
  if (s == x) ans -= 2;
  printf("%lld\n", ans);
  return 0;
}

### Prompt

Please create a solution in CPP 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;
vector<string> _split(const string& s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return v;
}
void _print(vector<string>::iterator) {}
template <typename T, typename... Args>
void _print(vector<string>::iterator it, T a, Args... args) {
  string name = it->substr((*it)[0] == ' ', it->length());
  if (isalpha(name[0]))
    cerr << name << " = " << a << " ";
  else
    cerr << name << " ";
  _print(++it, args...);
}
const int N = 80;
long long int dp[N][2];
vector<int> read() {
  long long int a;
  scanf("%lld", &a);
  vector<int> res;
  while (a > 0) {
    res.push_back(a % 2);
    a /= 2;
  }
  while ((int)res.size() < N) {
    res.push_back(0);
  }
  return res;
}
int main() {
  vector<int> s = read();
  vector<int> x = read();
  dp[0][0] = 1;
  for (int len = 0; len < N - 1; len++) {
    for (int flag = 0; flag < 2; flag++) {
      long long int cur_val = dp[len][flag];
      if (cur_val == 0) continue;
      for (int a = 0; a < 2; a++) {
        for (int b = 0; b < 2; b++) {
          if ((a ^ b) != x[len]) continue;
          int c = a + b + flag;
          if (c % 2 != s[len]) continue;
          dp[len + 1][c / 2] += cur_val;
        }
      }
    }
  }
  long long int ans = dp[N - 1][0];
  if (s == x) ans -= 2;
  printf("%lld\n", ans);
  return 0;
}

```