#include <bits/stdc++.h>
using namespace std;
const long long int INF = (long long int)2e18 + 77;
bool parity(long long int u, long long int v) {
  if ((u % 2 == 0 && v % 2 == 0) || (u % 2 == 1 && v % 2 == 1))
    return 0;
  else
    return 1;
}
void solve() {
  long long int u, v, x;
  cin >> u >> v;
  if (u == 0 && v == 0) {
    cout << "0\n";
    return;
  }
  if (u == v) {
    cout << "1\n" << u << "\n";
    return;
  }
  if (u > v || parity(u, v))
    cout << "-1\n";
  else {
    x = (v - u) / 2;
    if (x & u) {
      cout << "3\n";
      cout << u << " " << x << " " << x << "\n";
    } else {
      cout << "2\n";
      cout << x + u << " " << x << "\n";
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
