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