#include using ll = long long; using uint = unsigned int; using ull = unsigned long long; using ld = long double; template using max_heap = std::priority_queue; template using min_heap = std::priority_queue, std::greater>; constexpr int popcount(const ull v) { return v ? __builtin_popcountll(v) : 0; } constexpr int log2p1(const ull v) { return v ? 64 - __builtin_clzll(v) : 0; } constexpr int lsbp1(const ull v) { return __builtin_ffsll(v); } constexpr int clog(const ull v) { return v ? log2p1(v - 1) : 0; } constexpr ull ceil2(const ull v) { return 1ULL << clog(v); } constexpr ull floor2(const ull v) { return v ? (1ULL << (log2p1(v) - 1)) : 0ULL; } constexpr bool btest(const ull mask, const int ind) { return (mask >> ind) & 1ULL; } template void bset(T& mask, const int ind) { mask |= ((T)1 << ind); } template void breset(T& mask, const int ind) { mask &= ~((T)1 << ind); } template void bflip(T& mask, const int ind) { mask ^= ((T)1 << ind); } template void bset(T& mask, const int ind, const bool b) { (b ? bset(mask, ind) : breset(mask, ind)); } template bool chmin(T& a, const T& b) { return (a > b ? a = b, true : false); } template bool chmax(T& a, const T& b) { return (a < b ? a = b, true : false); } template constexpr T inf_v = std::numeric_limits::max() / 4; template constexpr Real pi_v = Real{3.141592653589793238462643383279502884}; template constexpr T TEN(const int n) { return n == 0 ? T{1} : TEN(n - 1) * T{10}; } template struct fix : F { fix(F&& f) : F{std::forward(f)} {} template auto operator()(Args&&... args) const { return F::operator()(*this, std::forward(args)...); } }; template auto nd_array(int const (&szs)[n], const T x = T{}) { if constexpr (i == n) { return x; } else { return std::vector(szs[i], nd_array(szs, x)); } } class printer { public: printer(std::ostream& os_ = std::cout) : os{os_} { os << std::fixed << std::setprecision(15); } template int operator()(const T& v) { return os << v, 0; } template int operator()(const std::vector& vs) { for (int i = 0; i < (int)vs.size(); i++) { os << (i ? " " : ""), this->operator()(vs[i]); } return 0; } template int operator()(const std::vector>& vss) { for (int i = 0; i < (int)vss.size(); i++) { os << (0 <= i or i + 1 < (int)vss.size() ? "\n" : ""), this->operator()(vss[i]); } return 0; } template int operator()(const T& v, const Args&... args) { return this->operator()(v), os << ' ', this->operator()(args...), 0; } template int ln(const Args&... args) { return this->operator()(args...), os << '\n', 0; } template int el(const Args&... args) { return this->operator()(args...), os << std::endl, 0; } template int fmt(const std::string& s, const Args&... args) { return rec(s, 0, args...); } private: int rec(const std::string& s, int index) { return os << s.substr(index, s.size()), 0; } template int rec(const std::string& s, int index, const T& v, const Args&... args) { return index == s.size() ? 0 : s[index] == '%' ? (this->operator()(v), rec(s, index + 1, args...)) : (os << s[index], rec(s, index + 1, v, args...)); } std::ostream& os; }; printer out; class scanner { public: scanner(std::istream& is_ = std::cin) : is{is_} { is.tie(nullptr), std::ios::sync_with_stdio(false); } template T val() { T v; return is >> v, v; } template T val(const T offset) { return val() - offset; } template std::vector vec(const int n) { std::vector vs(n); for (auto& v : vs) { v = val(); } return vs; } template std::vector vec(const int n, const T offset) { std::vector vs(n); for (auto& v : vs) { v = val(offset); } return vs; } template std::vector> vvec(const int n0, const int n1) { std::vector> vss(n0); for (auto& vs : vss) { vs = vec(n1); } return vss; } template std::vector> vvec(const int n0, const int n1, const T offset) { std::vector> vss(n0); for (auto& vs : vss) { vs = vec(n1, offset); } return vss; } template auto tup() { return std::tuple...>{val()...}; } template auto tup(const Args&... offsets) { return std::tuple...>{val(offsets)...}; } private: std::istream& is; }; scanner in; # define SHOW(...) static_cast(0) int main() { auto [K, X] = in.tup(); if (X == 0) { out.ln("Yes"); out.ln(1); out.ln(K ^ 1ULL); } std::vector bases; for (int i = 0; i < 20; i++) { bases.push_back(1ULL << i); } std::vector as; auto solve = [&](const ull X) { as = bases; int lg = log2(X); for (int i = 0; i < 20; i++) { if (lg == 0) { break; } as.push_back(bases[i]); lg--; } for (int m = 1; m < (1 << 20); m++) { if (popcount(m) == 1) { continue; } if (lg == 0) { break; } ull mask = 0; for (int i = 0; i < 20; i++) { if (btest(m, i)) { mask ^= (1ULL << i); } } as.push_back(mask); lg--; if (lg == 0) { break; } as.push_back(mask); lg--; } }; if (K == 0) { if (ceil2(X + 1) == X + 1) { solve(X + 1); } } else { if (ceil2(X) != X) { return out.ln("No"); } solve(X); } if (as.empty()) { return out.ln("No"); } assert(as.size() <= 40); out.ln("Yes"); out.ln(as.size()); out.ln(as); return 0; }