#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:10240000000,10240000000")
char ch;
int bo;
inline bool blank(char ch) {
  return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t';
}
inline void rd(int &x) {
  x = bo = 0;
  for (ch = getchar(); ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') bo = 1;
  for (; ch >= '0' && ch <= '9';
       x = (x << 1) + (x << 3) + ch - '0', ch = getchar())
    ;
  if (bo) x = -x;
}
inline void RD(long long &x) {
  x = bo = 0;
  for (ch = getchar(); ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') bo = 1;
  for (; ch >= '0' && ch <= '9';
       x = (x << 1) + (x << 3) + ch - '0', ch = getchar())
    ;
  if (bo) x = -x;
}
inline long long RD() {
  long long x;
  RD(x);
  return x;
}
inline int rd() {
  int x;
  rd(x);
  return x;
}
inline void RD(char *s) {
  for (ch = getchar(); blank(ch); ch = getchar())
    ;
  for (; !blank(ch); ch = getchar()) *s++ = ch;
  *s = 0;
}
inline void RD(char &c) {
  for (ch = getchar(); blank(c); ch = getchar())
    ;
}
template <class T>
inline void OT(T x) {
  static char buf[20];
  char *p1 = buf;
  if (!x) *p1++ = '0';
  if (x < 0) putchar('-'), x = -x;
  while (x) *p1++ = x % 10 + '0', x /= 10;
  while (p1-- != buf) putchar(*p1);
}
const int maxn = 1e6 + 20;
const int mod = 1e9 + 7;
long long dp[45][2];
long long dfs(bitset<45> a, bitset<45> b, int pos, int k) {
  if (pos < 0) {
    if (!k)
      return 1;
    else
      return 0;
  }
  if (dp[pos][k] != -1) return dp[pos][k];
  int s = a[pos];
  int x = b[pos];
  long long ret;
  if (k == 0) {
    if (s == 0 && x == 1) {
      ret = 0;
    } else if (s == 0 && x == 0) {
      ret = dfs(a, b, pos - 1, 0);
    } else if (s == 1 && x == 0) {
      ret = dfs(a, b, pos - 1, 1);
    } else if (s == 1 && x == 1) {
      ret = 2 * dfs(a, b, pos - 1, 0);
    }
  } else {
    if (s == 0 && x == 1) {
      ret = 2 * dfs(a, b, pos - 1, 1);
    } else if (s == 0 && x == 0) {
      ret = dfs(a, b, pos - 1, 0);
    } else if (s == 1 && x == 0) {
      ret = dfs(a, b, pos - 1, 1);
    } else if (s == 1 && x == 1) {
      ret = 0;
    }
  }
  return dp[pos][k] = ret;
}
int main() {
  long long s, x;
  RD(s), RD(x);
  bitset<45> a(s);
  bitset<45> b(x);
  memset(dp, -1, sizeof(dp));
  long long res = dfs(a, b, 43, 0);
  if (s == x) res -= 2;
  OT(res), puts("");
  ;
  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;
#pragma comment(linker, "/STACK:10240000000,10240000000")
char ch;
int bo;
inline bool blank(char ch) {
  return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t';
}
inline void rd(int &x) {
  x = bo = 0;
  for (ch = getchar(); ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') bo = 1;
  for (; ch >= '0' && ch <= '9';
       x = (x << 1) + (x << 3) + ch - '0', ch = getchar())
    ;
  if (bo) x = -x;
}
inline void RD(long long &x) {
  x = bo = 0;
  for (ch = getchar(); ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') bo = 1;
  for (; ch >= '0' && ch <= '9';
       x = (x << 1) + (x << 3) + ch - '0', ch = getchar())
    ;
  if (bo) x = -x;
}
inline long long RD() {
  long long x;
  RD(x);
  return x;
}
inline int rd() {
  int x;
  rd(x);
  return x;
}
inline void RD(char *s) {
  for (ch = getchar(); blank(ch); ch = getchar())
    ;
  for (; !blank(ch); ch = getchar()) *s++ = ch;
  *s = 0;
}
inline void RD(char &c) {
  for (ch = getchar(); blank(c); ch = getchar())
    ;
}
template <class T>
inline void OT(T x) {
  static char buf[20];
  char *p1 = buf;
  if (!x) *p1++ = '0';
  if (x < 0) putchar('-'), x = -x;
  while (x) *p1++ = x % 10 + '0', x /= 10;
  while (p1-- != buf) putchar(*p1);
}
const int maxn = 1e6 + 20;
const int mod = 1e9 + 7;
long long dp[45][2];
long long dfs(bitset<45> a, bitset<45> b, int pos, int k) {
  if (pos < 0) {
    if (!k)
      return 1;
    else
      return 0;
  }
  if (dp[pos][k] != -1) return dp[pos][k];
  int s = a[pos];
  int x = b[pos];
  long long ret;
  if (k == 0) {
    if (s == 0 && x == 1) {
      ret = 0;
    } else if (s == 0 && x == 0) {
      ret = dfs(a, b, pos - 1, 0);
    } else if (s == 1 && x == 0) {
      ret = dfs(a, b, pos - 1, 1);
    } else if (s == 1 && x == 1) {
      ret = 2 * dfs(a, b, pos - 1, 0);
    }
  } else {
    if (s == 0 && x == 1) {
      ret = 2 * dfs(a, b, pos - 1, 1);
    } else if (s == 0 && x == 0) {
      ret = dfs(a, b, pos - 1, 0);
    } else if (s == 1 && x == 0) {
      ret = dfs(a, b, pos - 1, 1);
    } else if (s == 1 && x == 1) {
      ret = 0;
    }
  }
  return dp[pos][k] = ret;
}
int main() {
  long long s, x;
  RD(s), RD(x);
  bitset<45> a(s);
  bitset<45> b(x);
  memset(dp, -1, sizeof(dp));
  long long res = dfs(a, b, 43, 0);
  if (s == x) res -= 2;
  OT(res), puts("");
  ;
  return 0;
}

```