#include <bits/stdc++.h>
using namespace std;
int main() {
  long long u, v;
  cin >> u >> v;
  if (u % 2 != v % 2 || u > v) {
    cout << -1 << '\n';
    return 0;
  }
  if (u == v) {
    if (!u) {
      cout << 0 << "\n";
    } else {
      cout << 1 << "\n";
      cout << u << "\n";
    }
    return 0;
  }
  long long x = (v - u) / 2;
  if (u & x)
    cout << 3 << "\n" << u << " " << x << " " << x;
  else
    cout << 2 << "\n" << (u ^ x) << " " << x;
}
