#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define llint long long #define PI 3.1415926535897932384626433832795028841971 #define inf 1e18 #define rep(x, s, t) for(llint (x) = (s); (x) < (t); (x)++) #define Rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++) #define chmin(x, y) (x) = min((x), (y)) #define chmax(x, y) (x) = max((x), (y)) #define mod 1000000007 using namespace std; typedef pair P; llint k, x; vector vec; void get(llint r) { if(r <= 26){ for(int i = 0; i < r/11; i++){ for(int j = 1; j <= 7; j++){ llint x = j<<(3*i); vec.push_back(x); vec.push_back(x); } } for(int i = 0; i < r%11; i++){ vec.push_back(1<<(r/11*3+i)); vec.push_back(1<<(r/11*3+i)); } } else{ for(int i = 0; i < r/26; i++){ for(int j = 1; j <= 15; j++){ llint x = j<<(4*i); vec.push_back(x); vec.push_back(x); } } for(int i = 0; i < r%26; i++){ vec.push_back(1<<(r/26*4+i)); vec.push_back(1<<(r/26*4+i)); } } } int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> k >> x; if(k == 0){ if(x == 0){ cout << "Yes" << endl; cout << 1 << endl; cout << 1 << endl; return 0; } if((x+1)&x){ cout << "No" << endl; return 0; } llint r = 0; x++; for(;x;x/=2) r++; r--; cout << "Yes" << endl; get(r); cout << vec.size() << endl; for(int i = 0; i < vec.size(); i++) cout << vec[i] << " "; cout << endl; return 0; } if(x == 0){ cout << "Yes" << endl; cout << 1 << endl; cout << 0 << endl; return 0; } if((x-1)&x){ cout << "No" << endl; return 0; } llint r = 0; for(;x;x/=2) r++; r--; llint b; for(int i = 0; i < 20; i++){ if(k & (1<> b) << (b+1) + x; } vec.push_back(k); cout << vec.size() << endl; for(int i = 0; i < vec.size(); i++) cout << vec[i] << " "; cout << endl; cout << endl; return 0; }