#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 51, MOD = 998244353, inf = 0x3f3f3f3f;
long long u, v, x, y;
inline long long read() {
  register long long num = 0, neg = 1;
  register char ch = getchar();
  while (!isdigit(ch) && ch != '-') ch = getchar();
  if (ch == '-') neg = -1, ch = getchar();
  while (isdigit(ch))
    num = (num << 3) + (num << 1) + (ch - '0'), ch = getchar();
  return neg == 1 ? num : -num;
}
inline long long int readu() {
  register long long int num = 0;
  register char ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch))
    num = (num << 3) + (num << 1) + (ch - '0'), ch = getchar();
  return num;
}
template <class T>
inline void writep(T x) {
  if (x < 0) {
    return (void)putchar('-'), writep(-x);
  }
  if (x < 10) {
    return (void)putchar(x | 48);
  }
  writep(x / 10), putchar((x % 10) | 48);
}
template <class T>
inline void write(T x, char ch = ' ') {
  writep(x), putchar(ch);
}
template <class T>
inline void writeln(T x) {
  writep(x), putchar('\n');
}
template <class T>
inline void chkmax(T &x, const T &y) {
  x = x > y ? x : y;
}
template <class T>
inline void chkmin(T &x, const T &y) {
  x = x < y ? x : y;
}
template <class T, class Compare>
inline void sort(vector<T> &v, Compare cmp = less<T>()) {
  sort(v.begin(), v.end(), cmp);
}
template <class T>
inline void reverse(vector<T> &v) {
  reverse(v.begin(), v.end());
}
template <class T>
inline void clear(T *arr) {
  memset(arr, 0, sizeof(arr));
}
template <class T>
inline void setInf(T *arr) {
  memset(arr, 0x3f, sizeof(arr));
}
inline long long qpow(long long base, long long exponent) {
  long long int res = 1;
  while (exponent) {
    if (exponent & 1) {
      res = (long long int)res * base % MOD;
    }
    base = (long long int)base * base % MOD, exponent >>= 1;
  }
  return res;
}
int main() {
  u = read(), v = read();
  if (u == 0 && v == 0) {
    return puts("0"), 0;
  }
  if (u == v) {
    return printf("1\n%lld", u), 0;
  }
  if (u > v || (v - u) & 1) {
    return puts("-1"), 0;
  }
  if ((u & ((v - u) >> 1)) == 0) {
    puts("2");
    return printf("%lld %lld\n", (u | ((v - u) >> 1)), (v - u) >> 1), 0;
  }
  printf("3\n%lld %lld %lld", u, (v - u) >> 1, (v - u) >> 1);
}
