#include <bits/stdc++.h>
using namespace std;
long long a, b, num;
vector<long long> v;
int main() {
  cin >> a >> b;
  if (a > b) {
    cout << -1;
  } else if (a == 0 && b == 0) {
    cout << 0;
  } else {
    long long c = b - a;
    if (c % 2)
      cout << -1;
    else {
      if (((a + c / 2) ^ (c / 2)) == a) {
        if (a + c / 2 != 0) v.push_back(a + c / 2);
        if (c / 2 != 0) v.push_back(c / 2);
        cout << v.size() << endl;
        for (int i = 0; i < v.size(); i++) {
          cout << v[i];
          if (i != v.size() - 1) cout << " ";
        }
      } else {
        if (a != 0) v.push_back(a);
        if (c / 2 != 0) v.push_back(c / 2), v.push_back(c / 2);
        cout << v.size() << endl;
        for (int i = 0; i < v.size(); i++) {
          cout << v[i];
          if (i != v.size() - 1) cout << " ";
        }
      }
    }
  }
  return 0;
}
