#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e5 + 5;
long long sa[105], sb[105];
long long sum[105];
long long ans[MAXN];
int main() {
  long long a, b;
  while (cin >> a >> b) {
    long long q1 = a, q2 = b;
    memset(sum, 0, sizeof(sum));
    memset(sa, 0, sizeof(sa));
    memset(sb, 0, sizeof(sb));
    memset(ans, 0, sizeof(ans));
    if ((a % 2) != (b % 2) || a > b) {
      cout << -1 << endl;
      continue;
    }
    long long t1 = 0, t2 = 0;
    while (a) {
      sa[++t1] = (a & 1);
      a /= 2;
    }
    while (b) {
      sb[++t2] = (b & 1);
      b /= 2;
    }
    long long tt = max(t1, t2);
    long long Max = 0;
    if (sa[1] == 1) sum[1] = 1;
    for (long long i = 2; i <= 62; i++) {
      if (sa[i] && sb[i]) {
        sum[i]++;
      }
      if (sa[i] && !sb[i]) {
        sum[i]++;
        sum[i - 1] += 2;
        long long idx = -1;
        for (long long j = i + 1; j <= 62; j++) {
          if (sb[j]) {
            idx = j;
            break;
          }
        }
        if (idx != -1) {
          for (long long j = i + 1; j < idx; j++) {
            sb[j] = 1;
          }
          sb[idx] = 0;
        }
      }
      if (!sa[i] && sb[i]) {
        sum[i - 1] += 2;
      }
      if (!sa[i] && !sb[i]) {
        continue;
      }
    }
    for (long long i = 1; i <= 62; i++) {
      Max = max(Max, sum[i]);
    }
    for (long long i = 1; i <= 62; i++) {
      for (long long j = 1; j <= sum[i]; j++) {
        ans[j] += (1ll << (i - 1));
      }
    }
    bool f = 0;
    long long s1 = 0, s2 = 0;
    cout << Max << endl;
    for (long long i = 1; i <= Max; i++) {
      cout << ans[i] << " ";
    }
    cout << endl;
  }
}
