#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
long long a[maxn];
vector<int> graph[maxn];
pair<int, int> edges[maxn];
int val[maxn];
int n;
void solve() {
  long long u, v;
  cin >> u >> v;
  if (v < u || (v - u) % 2) {
    cout << -1 << "\n";
    return;
  }
  if (u == v) {
    if (u == 0)
      cout << 0 << endl;
    else {
      cout << 1 << endl;
      cout << u << endl;
    }
    return;
  }
  long long t = (v - u) / 2;
  if ((t & u) == 0) {
    cout << 2 << endl;
    cout << u + t << " " << t << endl;
    return;
  }
  cout << 3 << endl;
  cout << u << " " << t << " " << t << "\n";
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
