#include <bits/stdc++.h>
using namespace std;
const int maxn = 123;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  return x * f;
}
long long a[maxn], ans[maxn], tot = 0;
long long num[maxn];
long long vis[maxn];
long long b[maxn];
long long total = 0;
bool solve() {
  long long minv = 1e18;
  long long shu = 0;
  for (long long i = 0; i <= 62; i++) {
    if (vis[i]) minv = min(minv, vis[i]);
  }
  if (minv == 1e18) return false;
  minv = min(minv, (long long)1);
  for (long long i = 0; i <= 62; i++) {
    if (vis[i] == 0) continue;
    vis[i] -= minv;
    shu += a[i];
  }
  ans[++tot] = shu;
  return true;
}
int main(void) {
  cin.tie(0);
  std::ios::sync_with_stdio(false);
  long long u, v;
  cin >> u >> v;
  if (u == v && u != 0) {
    cout << 1 << "\n" << u << "\n";
    return 0;
  }
  a[0] = 1;
  for (long long i = 1; i <= 62; i++) a[i] = a[i - 1] * 2;
  for (long long i = 62; i >= 0; i--) {
    if (a[i] & u) vis[i] = 1, v -= a[i];
  }
  if (v < 0) {
    cout << "-1"
         << "\n";
    return 0;
  }
  for (long long i = 62; i >= 0; i--) {
    long long temp = v / a[i];
    if (temp == 0) continue;
    if (vis[i]) {
      if (temp % 2 == 1) temp--;
    } else if (!vis[i]) {
      if (temp % 2 == 1) temp--;
    }
    vis[i] += temp;
    v -= temp * a[i];
  }
  if (v != 0) {
    cout << "-1"
         << "\n";
    return 0;
  }
  while (solve() == 1) continue;
  cout << tot << "\n";
  for (long long i = 1; i <= tot; i++) {
    cout << ans[i] << " ";
  }
  cout << "\n";
  return 0;
}
