#include <bits/stdc++.h>
using namespace std;
const double pi = 3.141592653589;
long long int mod = 1000000007;
int main() {
  int t = 1;
  while (t--) {
    long long int u, v, x;
    cin >> u >> v;
    x = (v - u) / 2;
    if (u + v == 0) {
      cout << 0;
    } else if (u == v) {
      cout << 1 << endl;
      cout << v << endl;
    } else if (u > v) {
      cout << -1;
    } else if ((v - u) % 2 == 1) {
      cout << -1;
    } else if (u == 0) {
      cout << 2 << endl;
      cout << v / 2 << " " << v / 2;
    } else if ((u & x) == 0) {
      cout << 2 << endl;
      cout << x << " " << u + x;
    } else {
      cout << 3 << endl;
      cout << (v - u) / 2 << " " << (v - u) / 2 << " " << u;
    }
  }
}
