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