#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ui = unsigned int;
using pii = pair<int, int>;
using pll = pair<int, int>;
struct fast_ios {
  fast_ios() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
  }
} fast_ios_;
ll u, v, a;
int solve() {
  cin >> u >> v;
  if (u > v || (v - u) & 1) return puts("-1"), 0;
  if (u + v == 0) return puts("0"), 0;
  if (u == v) return printf("1\n%lld\n", u), 0;
  a = (v - u) / 2;
  if (u & a) return printf("3\n%lld %lld %lld\n", u, a, a), 0;
  return printf("2\n%lld %lld\n", u + a, a), 0;
}
int main() {
  solve();
  return 0;
}
