#include <bits/stdc++.h>
using namespace std;
istream* pin;
uintmax_t konstansmod = (1e9) + 7;
template <typename T>
vector<T> read(int num = -1, int szorzo = 1, istream& in = *pin) {
  vector<T> container;
  if (num == -1) in >> num;
  num *= szorzo;
  for (int i = 0; i < num; i++) {
    T q;
    in >> q;
    container.push_back(q);
  }
  return container;
}
struct printer {
  ostream* o;
  printer(ostream& a = cout) : o(&a) {}
  void pr() { *o << "\n"; }
  template <typename T>
  void pr(T uintmax_t) {
    *o << std::setprecision(9) << uintmax_t << "\n";
  }
  template <typename T>
  void pr(vector<T> uintmax_t) {
    for (T w : uintmax_t) pr(w);
    pr();
  }
  template <typename T, typename... Args>
  void pr(T value, Args... args) {
    pr(value);
    pr(args...);
  }
};
template <typename H1>
void show(std::ostream& out, const char* label, H1&& value) {
  out << label << "=";
  printer(out).pr(value);
}
template <typename H1, typename... T>
void show(std::ostream& out, const char* label, H1&& value, T&&... rest) {
  const char* pcomma = strchr(label, ',');
  out.write(label, pcomma - label) << "=";
  printer(out).pr(value);
  show(out, pcomma + 1, std::forward<T>(rest)...);
}
void print(bool b) { cout << (b ? "Yes" : "No") << "\n"; }
void solve();
int main(int argc, char** argv) {
  srand((unsigned)time(NULL));
  ifstream* argfile = NULL;
  string filename = "";
  if (argc >= 2 && filename.length() == 0) filename = argv[1];
  if (filename.length() > 0) {
    argfile = new ifstream(filename);
    if (!argfile->is_open()) {
      cerr << "file cant be opened,exiting. Filename:" << filename << "\n";
      cerr << "Error: " << strerror(errno) << "\n";
      return 1;
    }
  }
  if (argfile) std::cin.rdbuf(argfile->rdbuf());
  istream& myfile = argfile ? *argfile : cin;
  pin = &myfile;
  int num;
  solve();
  return 0;
  myfile >> num;
  for (int i = 0; i < num; i++) {
    cout << "Case #" << (i + 1) << ": ";
    solve();
  }
  return 0;
}
void solve() {
  uintmax_t sum2;
  uintmax_t xor2;
  cin >> sum2 >> xor2;
  string a, b;
  int m = 0;
  uintmax_t ret = 1;
  bool nullaopcio = true;
  for (int i = 55; i >= 0; i--) {
    uintmax_t muj = 0;
    uintmax_t aa = ((uintmax_t)1) << i;
    uintmax_t s = sum2 & aa;
    uintmax_t x = xor2 & aa;
    {};
    if (x == 0) {
      if (s == 0 && !m) {
        a = a + "0";
        b = b + "0";
      } else if (s && !m) {
        muj = 1;
        a = a + "0";
        b = b + "0";
      } else if (s == 0 && m) {
        muj = 0;
        nullaopcio = false;
        a = a + "1";
        b = b + "1";
      } else if (s && m) {
        muj = 1;
        nullaopcio = false;
        a = a + "1";
        b = b + "1";
      }
    } else {
      if (s == 0 && !m) {
        m = 1;
        break;
      } else if (s && !m) {
        ret = ret * 2;
        {};
        a = a + "1";
        b = b + "0";
      } else if (s == 0 && m) {
        muj = 1;
        ret = ret * 2;
        a = a + "1";
        b = b + "0";
      } else if (s && m) {
        m = 1;
        break;
      }
    }
    m = muj;
  }
  if (nullaopcio) ret -= 2;
  if (m)
    printf("0\n");
  else
    printer().pr(ret);
  ;
}

### Prompt

Please provide a cpp coded solution to the problem described below:

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;
istream* pin;
uintmax_t konstansmod = (1e9) + 7;
template <typename T>
vector<T> read(int num = -1, int szorzo = 1, istream& in = *pin) {
  vector<T> container;
  if (num == -1) in >> num;
  num *= szorzo;
  for (int i = 0; i < num; i++) {
    T q;
    in >> q;
    container.push_back(q);
  }
  return container;
}
struct printer {
  ostream* o;
  printer(ostream& a = cout) : o(&a) {}
  void pr() { *o << "\n"; }
  template <typename T>
  void pr(T uintmax_t) {
    *o << std::setprecision(9) << uintmax_t << "\n";
  }
  template <typename T>
  void pr(vector<T> uintmax_t) {
    for (T w : uintmax_t) pr(w);
    pr();
  }
  template <typename T, typename... Args>
  void pr(T value, Args... args) {
    pr(value);
    pr(args...);
  }
};
template <typename H1>
void show(std::ostream& out, const char* label, H1&& value) {
  out << label << "=";
  printer(out).pr(value);
}
template <typename H1, typename... T>
void show(std::ostream& out, const char* label, H1&& value, T&&... rest) {
  const char* pcomma = strchr(label, ',');
  out.write(label, pcomma - label) << "=";
  printer(out).pr(value);
  show(out, pcomma + 1, std::forward<T>(rest)...);
}
void print(bool b) { cout << (b ? "Yes" : "No") << "\n"; }
void solve();
int main(int argc, char** argv) {
  srand((unsigned)time(NULL));
  ifstream* argfile = NULL;
  string filename = "";
  if (argc >= 2 && filename.length() == 0) filename = argv[1];
  if (filename.length() > 0) {
    argfile = new ifstream(filename);
    if (!argfile->is_open()) {
      cerr << "file cant be opened,exiting. Filename:" << filename << "\n";
      cerr << "Error: " << strerror(errno) << "\n";
      return 1;
    }
  }
  if (argfile) std::cin.rdbuf(argfile->rdbuf());
  istream& myfile = argfile ? *argfile : cin;
  pin = &myfile;
  int num;
  solve();
  return 0;
  myfile >> num;
  for (int i = 0; i < num; i++) {
    cout << "Case #" << (i + 1) << ": ";
    solve();
  }
  return 0;
}
void solve() {
  uintmax_t sum2;
  uintmax_t xor2;
  cin >> sum2 >> xor2;
  string a, b;
  int m = 0;
  uintmax_t ret = 1;
  bool nullaopcio = true;
  for (int i = 55; i >= 0; i--) {
    uintmax_t muj = 0;
    uintmax_t aa = ((uintmax_t)1) << i;
    uintmax_t s = sum2 & aa;
    uintmax_t x = xor2 & aa;
    {};
    if (x == 0) {
      if (s == 0 && !m) {
        a = a + "0";
        b = b + "0";
      } else if (s && !m) {
        muj = 1;
        a = a + "0";
        b = b + "0";
      } else if (s == 0 && m) {
        muj = 0;
        nullaopcio = false;
        a = a + "1";
        b = b + "1";
      } else if (s && m) {
        muj = 1;
        nullaopcio = false;
        a = a + "1";
        b = b + "1";
      }
    } else {
      if (s == 0 && !m) {
        m = 1;
        break;
      } else if (s && !m) {
        ret = ret * 2;
        {};
        a = a + "1";
        b = b + "0";
      } else if (s == 0 && m) {
        muj = 1;
        ret = ret * 2;
        a = a + "1";
        b = b + "0";
      } else if (s && m) {
        m = 1;
        break;
      }
    }
    m = muj;
  }
  if (nullaopcio) ret -= 2;
  if (m)
    printf("0\n");
  else
    printer().pr(ret);
  ;
}

```