#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll inf = LONG_LONG_MAX;
const ll mod = 1e9 + 7;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll u, v;
  cin >> u >> v;
  if (u > v || (u % 2 != v % 2)) {
    cout << "-1\n";
  } else {
    if (u == v) {
      if (u == 0) {
        cout << "0\n";
      } else {
        cout << "1\n" << u << "\n";
      }
    } else {
      ll x = (v - u) / 2;
      if ((x & u) == 0) {
        cout << 2 << "\n" << u + x << " " << x << "\n";
      } else {
        cout << 3 << "\n";
        cout << u << " " << x << " " << x << "\n";
      }
    }
  }
  return 0;
}
