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