#include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int N,M; cin >> N >> M; vector A(N); for(auto &a : A) cin >> a; sort(A.begin(),A.end()); priority_queue,vector>,greater<>> Q; bool ok = true; vector B; for(int i=1; i a) break; else if(t < a){ok = false; break;} Q.pop(); Q.push({t+add,add}); already = true; } if(!ok) break; if(!already) Q.push({a+a,a}),B.push_back(a); } if(Q.top().first <= M || !ok) cout << "-1" << endl; else if(ok){ cout << B.size() << endl; for(auto &b : B) cout << b << " "; cout << endl; } else cout << -1 << endl; }