namespace AtCoder; #nullable enable using System.Numerics; static class Extensions { public static T[] Repeat(this int time, Func F) => Enumerable.Range(0, time).Select(_ => F()).ToArray(); } class AtCoder { object? Solve() { var n = Int(); var m = Int(); var b = new List(); var o = new HashSet(); var q = new PriorityQueue<(int, int), (int, int)>(); var max = int.MaxValue; var c = new HashSet(); Int(); for (var i = 1; i < n; i++) { var a = Int(); q.Enqueue((a, 0), (a, 0)); } while (q.Count > 0) { var (v, k) = q.Dequeue(); if (k == 0) { o.Add(v); if (c.Contains(v)) continue; b.Add(v); c.Add(v); var v2 = v * 2; if (v2 > m) continue; c.Add(v2); q.Enqueue((v2, v), (v2, v)); } else { if (!o.Contains(v)) return -1; var v2 = v + k; if (v2 > m) continue; c.Add(v2); q.Enqueue((v2, k), (v2, k)); } } Out(b.Count); Out(b, " "); return null; } public static void Main() => new AtCoder().Run(); public void Run() { var res = Solve(); if (res != null) { if (res is bool yes) res = yes ? "Yes" : "No"; sw.WriteLine(res); } sw.Flush(); } string[] input = Array.Empty(); int iter = 0; readonly StreamWriter sw = new(Console.OpenStandardOutput()) { AutoFlush = false }; string String() { while (iter >= input.Length) (input, iter) = (Console.ReadLine()!.Split(' '), 0); return input[iter++]; } T Input() where T : IParsable => T.Parse(String(), null); int Int() => Input(); void Out(object? x, string? separator = null) { separator ??= Environment.NewLine; if (x is System.Collections.IEnumerable obj and not string) { var firstLine = true; foreach (var item in obj) { if (!firstLine) sw.Write(separator); firstLine = false; sw.Write(item); } } else sw.Write(x); sw.WriteLine(); } }