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