#include using namespace std; typedef long long ll; int main() { int n, m; cin >> n >> m; vector a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a.begin(), a.end()); set s; vector ans; bool isok = true; for (int i = 0; i < n; i++) { if (a[i] == 0) continue; if (s.count(a[i])) continue; if (m / a[i] > n) { isok = false; break; } ans.push_back(a[i]); for (int j = 1; (ll)j * a[i] <= m; j++) { s.insert(j * a[i]); } } set sa; for (int i = 0; i < n; i++) { sa.insert(a[i]); } for (auto v : s) { if (!sa.count(v)) { isok = false; break; } } if (isok) { int sz = ans.size(); cout << sz << endl; for (int i = 0; i < sz; i++) { cout << ans[i]; if (i == sz - 1) cout << endl; else cout << " "; } } else { cout << -1 << endl; } return 0; }