#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int s, x, y, a, b = 0;
  cin >> s >> x;
  int f = 1;
  if (s < x) f = 0;
  if (s == x) b = 2;
  y = s - x;
  if (y % 2 == 1) f = 0;
  if (f) {
    y /= 2, a = 1;
    while (x > 0 || y > 0) {
      if (x % 2 == 1) {
        if (y % 2 == 0)
          a *= 2;
        else
          f = 0;
      }
      x /= 2, y /= 2;
    }
  }
  a *= f;
  cout << a - b << endl;
}
