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