#include <bits/stdc++.h>
using namespace std;
long long n, m;
int main() {
  cin >> n >> m;
  if (n > m || (n % 2 != m % 2))
    cout << "-1\n";
  else {
    long long f = (m - n) / 2;
    if (m == 0)
      cout << "0\n";
    else if (n == m)
      cout << "1\n" << n << '\n';
    else if (!(f & n)) {
      cout << "2\n";
      cout << n + f << ' ' << f << '\n';
    } else {
      cout << "3\n";
      cout << n << ' ' << f << ' ' << f << '\n';
    }
  }
}
