#include <bits/stdc++.h>
using namespace std;
enum enum_t { White, Black, Gray };
inline int readInt() {
  char c;
  while (c = getchar(), c != '-' && (c < '0' || c > '9'))
    ;
  bool sign = (c == '-');
  if (sign) c = getchar();
  int n = c - '0';
  while (c = getchar(), c >= '0' && c <= '9') n = 10 * n + c - '0';
  return (!sign) ? n : -n;
}
inline long long readLong() {
  char c;
  while (c = getchar(), c != '-' && (c < '0' || c > '9'))
    ;
  bool sign = (c == '-');
  if (sign) c = getchar();
  long long n = c - '0';
  while (c = getchar(), c >= '0' && c <= '9') n = 10 * n + c - '0';
  return (!sign) ? n : -n;
}
inline void getInt(int &n) {
  char c;
  while (c = getchar(), c != '-' && (c < '0' || c > '9'))
    ;
  bool sign = (c == '-');
  if (sign) c = getchar();
  n = c - '0';
  while (c = getchar(), c >= '0' && c <= '9') n = 10 * n + c - '0';
  if (sign) n = -n;
}
inline void getLong(long long &n) {
  char c;
  while (c = getchar(), c != '-' && (c < '0' || c > '9'))
    ;
  bool sign = (c == '-');
  if (sign) c = getchar();
  n = c - '0';
  while (c = getchar(), c >= '0' && c <= '9') n = 10 * n + c - '0';
  if (sign) n = -n;
}
inline string readString() {
  char c;
  while (c = getchar(), c == ' ' || c == '\n' || c == '\t')
    ;
  string s({c});
  while (c = getchar(), c != EOF && c != ' ' && c != '\n' && c != '\t') s += c;
  return s;
}
char bufWrite[20];
template <typename T>
inline void writeInt(T x) {
  if (x < 0) putchar('-'), x = -x;
  char *bufPos = bufWrite;
  do {
    *bufPos++ = x % 10 + '0';
  } while (x /= 10);
  do {
    putchar(*--bufPos);
  } while (bufPos > bufWrite);
}
template <typename T>
inline void printInt(T x, char c = EOF) {
  if (x < 0) putchar('-'), x = -x;
  char *bufPos = bufWrite;
  do {
    *bufPos++ = x % 10 + '0';
  } while (x /= 10);
  do {
    putchar(*--bufPos);
  } while (bufPos > bufWrite);
  if (c != EOF) putchar(c);
}
template <typename T>
inline T gcd(T a, T b) {
  while (b != 0) swap(b, a %= b);
  return a;
}
template <typename T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T>
inline tuple<T, T, T> extgcd(T a, T b) {
  if (!a) return make_tuple(b, 0, 1);
  T g, x, y;
  tie(g, x, y) = extgcd(b % a, a);
  return make_tuple(g, y - (b / a) * x, x);
}
template <typename T>
inline bool bitGet(T x, int bit) {
  return T(1) & (x >> bit);
}
template <typename T>
inline void bitSet(T &x, int bit) {
  x |= (T(1) << bit);
}
template <typename T>
inline void bitReset(T &x, int bit) {
  x &= ~(T(1) << bit);
}
template <typename T>
inline void bitFlip(T &x, int bit) {
  x ^= (T(1) << bit);
}
template <typename T>
inline void bitMake(T &x, int bit, bool v) {
  x ^= (T(1) << bit) & (-v ^ x);
}
const long long LINF = (1LL << 60);
const int INF = (1 << 30);
const int LIM = (1 << 24);
const int MOD = 1e9 + 7;
const int BASE = 1e4;
const int DIGIT = 4;
long long sum, sor;
int pos;
long long bnb(int bit = 0, long long vala = 0, long long valb = 0) {
  if (bit > pos) return (vala + valb == sum) && ((vala ^ valb) == sor);
  long long test = ((1LL << bit) - 1);
  long long testx = sum & test;
  long long testy = (vala + valb) & test;
  if (testx != testy) return 0;
  int val = bitGet(sum, bit);
  int dif = bitGet(sor, bit);
  long long add = 1LL << bit;
  long long res = 0;
  if (dif)
    res = 2 * bnb(bit + 1, vala | add, valb);
  else
    res = bnb(bit + 1, vala | add, valb | add) + bnb(bit + 1, vala, valb);
  return res;
}
long long trau(int bit = 0, long long vala = 0, long long valb = 0) {
  if (bit > pos) return (vala + valb == sum) && (vala ^ valb == sor);
  int val = bitGet(sum, bit);
  int dif = bitGet(sor, bit);
  long long add = 1LL << bit;
  long long res = 0;
  if (dif)
    res = 2 * trau(bit + 1, vala | add, valb);
  else
    res = trau(bit + 1, vala | add, valb | add) + trau(bit + 1, vala, valb);
  return res;
}
int main() {
  sum = readLong();
  sor = readLong();
  for (pos = 62; pos >= 0; pos--)
    if (bitGet(sum, pos) == 1) break;
  cout << bnb() - 2 * (sum == sor);
  return 0;
}

### Prompt

Create a solution in CPP for 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;
enum enum_t { White, Black, Gray };
inline int readInt() {
  char c;
  while (c = getchar(), c != '-' && (c < '0' || c > '9'))
    ;
  bool sign = (c == '-');
  if (sign) c = getchar();
  int n = c - '0';
  while (c = getchar(), c >= '0' && c <= '9') n = 10 * n + c - '0';
  return (!sign) ? n : -n;
}
inline long long readLong() {
  char c;
  while (c = getchar(), c != '-' && (c < '0' || c > '9'))
    ;
  bool sign = (c == '-');
  if (sign) c = getchar();
  long long n = c - '0';
  while (c = getchar(), c >= '0' && c <= '9') n = 10 * n + c - '0';
  return (!sign) ? n : -n;
}
inline void getInt(int &n) {
  char c;
  while (c = getchar(), c != '-' && (c < '0' || c > '9'))
    ;
  bool sign = (c == '-');
  if (sign) c = getchar();
  n = c - '0';
  while (c = getchar(), c >= '0' && c <= '9') n = 10 * n + c - '0';
  if (sign) n = -n;
}
inline void getLong(long long &n) {
  char c;
  while (c = getchar(), c != '-' && (c < '0' || c > '9'))
    ;
  bool sign = (c == '-');
  if (sign) c = getchar();
  n = c - '0';
  while (c = getchar(), c >= '0' && c <= '9') n = 10 * n + c - '0';
  if (sign) n = -n;
}
inline string readString() {
  char c;
  while (c = getchar(), c == ' ' || c == '\n' || c == '\t')
    ;
  string s({c});
  while (c = getchar(), c != EOF && c != ' ' && c != '\n' && c != '\t') s += c;
  return s;
}
char bufWrite[20];
template <typename T>
inline void writeInt(T x) {
  if (x < 0) putchar('-'), x = -x;
  char *bufPos = bufWrite;
  do {
    *bufPos++ = x % 10 + '0';
  } while (x /= 10);
  do {
    putchar(*--bufPos);
  } while (bufPos > bufWrite);
}
template <typename T>
inline void printInt(T x, char c = EOF) {
  if (x < 0) putchar('-'), x = -x;
  char *bufPos = bufWrite;
  do {
    *bufPos++ = x % 10 + '0';
  } while (x /= 10);
  do {
    putchar(*--bufPos);
  } while (bufPos > bufWrite);
  if (c != EOF) putchar(c);
}
template <typename T>
inline T gcd(T a, T b) {
  while (b != 0) swap(b, a %= b);
  return a;
}
template <typename T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T>
inline tuple<T, T, T> extgcd(T a, T b) {
  if (!a) return make_tuple(b, 0, 1);
  T g, x, y;
  tie(g, x, y) = extgcd(b % a, a);
  return make_tuple(g, y - (b / a) * x, x);
}
template <typename T>
inline bool bitGet(T x, int bit) {
  return T(1) & (x >> bit);
}
template <typename T>
inline void bitSet(T &x, int bit) {
  x |= (T(1) << bit);
}
template <typename T>
inline void bitReset(T &x, int bit) {
  x &= ~(T(1) << bit);
}
template <typename T>
inline void bitFlip(T &x, int bit) {
  x ^= (T(1) << bit);
}
template <typename T>
inline void bitMake(T &x, int bit, bool v) {
  x ^= (T(1) << bit) & (-v ^ x);
}
const long long LINF = (1LL << 60);
const int INF = (1 << 30);
const int LIM = (1 << 24);
const int MOD = 1e9 + 7;
const int BASE = 1e4;
const int DIGIT = 4;
long long sum, sor;
int pos;
long long bnb(int bit = 0, long long vala = 0, long long valb = 0) {
  if (bit > pos) return (vala + valb == sum) && ((vala ^ valb) == sor);
  long long test = ((1LL << bit) - 1);
  long long testx = sum & test;
  long long testy = (vala + valb) & test;
  if (testx != testy) return 0;
  int val = bitGet(sum, bit);
  int dif = bitGet(sor, bit);
  long long add = 1LL << bit;
  long long res = 0;
  if (dif)
    res = 2 * bnb(bit + 1, vala | add, valb);
  else
    res = bnb(bit + 1, vala | add, valb | add) + bnb(bit + 1, vala, valb);
  return res;
}
long long trau(int bit = 0, long long vala = 0, long long valb = 0) {
  if (bit > pos) return (vala + valb == sum) && (vala ^ valb == sor);
  int val = bitGet(sum, bit);
  int dif = bitGet(sor, bit);
  long long add = 1LL << bit;
  long long res = 0;
  if (dif)
    res = 2 * trau(bit + 1, vala | add, valb);
  else
    res = trau(bit + 1, vala | add, valb | add) + trau(bit + 1, vala, valb);
  return res;
}
int main() {
  sum = readLong();
  sor = readLong();
  for (pos = 62; pos >= 0; pos--)
    if (bitGet(sum, pos) == 1) break;
  cout << bnb() - 2 * (sum == sor);
  return 0;
}

```