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