#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, m, a[maxn];
int v[20 * maxn], top;
int bin(int i, int j, int x) {
  int lb, rb, mid;
  lb = i, rb = j;
  while (rb - lb > 1) {
    mid = (lb + rb) >> 1;
    if (1LL * (mid - i) * (i + 1 + mid) / 2LL <= m)
      lb = mid;
    else
      rb = mid;
  }
  return lb;
}
int main() {
  int i, j, ans = 0;
  scanf("%d%d", &n, &m);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  a[n++] = 1e9 + 1;
  a[n++] = 0;
  sort(a, a + n);
  int tmp;
  for (i = 0; i < n - 1; i++) {
    tmp = bin(a[i], a[i + 1], m);
    ans += tmp - a[i];
    m -= (tmp - a[i]) * (a[i] + 1 + tmp) / 2;
    for (j = a[i] + 1; j <= tmp; j++) v[top++] = j;
  }
  printf("%d\n", ans);
  for (i = 0; i < top; i++) {
    if (i) putchar(' ');
    printf("%d", v[i]);
  }
  putchar('\n');
  return 0;
}
