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