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