#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
long long read() {
  long long s = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = s * 10 + ch - '0';
    ch = getchar();
  }
  return s * f;
}
inline void print(long long *f, long long len) {
  for (long long i = 0; i < len; i++) printf("%lld ", f[i]);
  puts("");
}
signed main() {
  long long s = read(), x = read();
  long long ze = s - x;
  if (ze < 0 || ze & 1 || (ze / 2) & x)
    puts("0");
  else {
    if (((ze / 2) ^ (s - ze / 2)) != x) {
      puts("NO");
      return 0;
    }
    cout << (1ll << (__builtin_popcountll(x))) - 2 * (s == x);
  }
}
