#include <bits/stdc++.h>
int main() {
  long long u, v, a, b;
  scanf("%lld%lld", &u, &v);
  if (v == 0)
    printf("0\n");
  else if (u > v)
    printf("-1\n");
  else if (u == v) {
    printf("1\n");
    printf("%lld\n", u);
  } else if ((v - u) % 2 == 0) {
    a = u, b = (v - u) / 2;
    if ((a ^ b) == (a + b)) {
      printf("2\n");
      printf("%lld %lld\n", a + b, b);
    } else {
      printf("3\n");
      printf("%lld %lld %lld\n", a, b, b);
    }
  } else
    printf("-1\n");
  return 0;
}
