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