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