#include <bits/stdc++.h>
using namespace std;
int inf = 0x3f3f3f3f;
long long linf = 0x3f3f3f3f3f3f3f3f;
vector<int> sol;
int main() {
  long long x, s;
  cin >> x >> s;
  if (x > s) {
    puts("-1");
    return 0;
  }
  if (x == 0 && s == 0) {
    puts("0");
    return 0;
  }
  if (x == s) {
    cout << "1\n" << s << endl;
    return 0;
  }
  if ((s - x) % 2) {
    puts("-1");
    return 0;
  }
  long long a, b;
  b = a = (s - x) / 2;
  if (a + b + x != s) {
    puts("-1");
    return 0;
  }
  if (a == 0) {
    if (b + x == s && (b ^ x) == x) {
      puts("2");
      cout << b << " " << x << endl;
    } else {
      puts("-1");
    }
  } else if (b + x == (b ^ x)) {
    puts("2");
    cout << a << " " << b + x << " " << endl;
  } else {
    puts("3");
    cout << a << " " << b << " " << x << endl;
  }
  return 0;
}
