#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long n, long long mod) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) {
      res = (res * a) % mod;
    }
    a = (a * a) % mod;
    n = n / 2;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    unsigned long long u, v;
    cin >> u >> v;
    if (u > v || (v - u) % 2) {
      cout << "-1\n";
    } else if (u == v) {
      if (!v) {
        cout << "0\n";
      } else {
        cout << "1\n" << u << "\n";
      }
    } else {
      unsigned long long _and = (v - u) / 2;
      if (u & _and) {
        cout << "3\n";
        cout << _and << " " << _and << " " << u << "\n";
      } else {
        cout << "2\n";
        cout << (u ^ _and) << " " << _and << "\n";
      }
    }
  }
}
