#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count());
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  long long u, v;
  cin >> u >> v;
  if ((v - u) % 2 || u > v)
    cout << -1;
  else if (!u && !v)
    cout << 0;
  else if (u == v)
    cout << "1\n" << u;
  else {
    long long p = (v - u) / 2;
    if (p + (u ^ p) == v)
      cout << "2\n" << p << ' ' << (u ^ p);
    else
      cout << "3\n" << u << ' ' << p << ' ' << p;
  }
  return 0;
}
