#include <bits/stdc++.h>
using namespace std;
int main() {
  long long xr, sm;
  cin >> xr >> sm;
  if (xr > sm || xr % 2 != sm % 2) {
    cout << -1;
    return 0;
  }
  if (xr == 0 && sm == 0) {
    cout << 0;
    return 0;
  }
  if (xr == 0) {
    cout << 2 << endl;
    cout << sm / 2 << " " << sm / 2 << endl;
    return 0;
  }
  if (sm == xr) {
    cout << 1 << endl;
    cout << sm;
    return 0;
  }
  long long am = (sm + xr) / 2;
  long long sc = sm - am;
  if (sc > 0 && (am ^ sc) == xr) {
    cout << 2 << endl << am << " " << sc;
    return 0;
  }
  cout << 3 << endl;
  cout << xr << " " << (sm - xr) / 2 << " " << (sm - xr) / 2;
}
