#include <bits/stdc++.h>
using namespace std;
long long n, ans[100001], curr, deg[100001] = {0};
vector<pair<int, int>> adj[100001];
void dfs(long long u, long long p) {
  for (auto v : adj[u]) {
    if (v.first == p) {
      continue;
    }
    if (ans[v.second] == -1) {
      ans[v.second] = curr++;
    }
    dfs(v.first, u);
  }
}
void solve() {
  long long n;
  cin >> n;
  long long m;
  cin >> m;
  if (n > m || n % 2 != m % 2) {
    cout << -1 << endl;
    return;
  }
  if (n == m && n == 0) {
    cout << n << endl;
    return;
  }
  if (n == m) {
    cout << 1 << endl << n << endl;
    return;
  }
  long long x = (m - n) / 2;
  if ((x & n) == 0) {
    cout << 2 << endl << n + x << " " << x << endl;
    return;
  }
  {
    cout << 3 << endl << n << " " << x << " " << x << endl;
    return;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  solve();
  return 0;
}
