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