#define _USE_MATH_DEFINES #include using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int k, x; cin >> k >> x; if (x == 0) { cout << "Yes" << endl; cout << 1 << endl; cout << (k ^ 1) << endl; return 0; } if (k == 0) x++; bool ok = false; for (int i = 0; i <= 30; i++) if ((1 << i) == x) ok = true; if (!ok) { cout << "No" << endl; return 0; } vector ans; for (int i = 1; x > 1; i++) { ans.push_back(i); if (__builtin_popcount(i) != 1) x >>= 1; } if (k > 0 && (ans.empty() || __builtin_clz(ans.back()) > __builtin_clz(k))) ans.push_back(k); cout << "Yes" << endl; cout << ans.size() << endl; for (int i = 0; i < (int) ans.size(); i++) { if (i > 0) cout << " "; cout << ans[i]; } cout << endl; return 0; }