#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long u, v;
  cin >> u >> v;
  if ((u > v) || (u % 2 != v % 2)) {
    cout << -1 << endl;
    return 0;
  }
  if (u == v && u == 0) {
    cout << 0 << endl;
    return 0;
  }
  if (u == v && u != 0) {
    cout << 1 << endl;
    cout << u << endl;
    cout << endl;
    return 0;
  }
  long long x = (v - u) / 2;
  if ((x ^ u) == (x + u)) {
    cout << 2 << endl;
    cout << x << " " << (u + v) / 2 << endl;
    return 0;
  }
  cout << 3 << endl;
  cout << u << " " << x << " " << x << endl;
  return 0;
}
