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