#include <bits/stdc++.h>

using namespace std;

int main()
{
    int N,K,brojac = 0;
    cin >> N >> K;
    int *polja = new int[2*N];
    vector<int> resenja;
    for(int i = 0;i<2*N+1;i++)
    {
        polja[i] = K;
    }
    for(int i = 0;i<N;i++)
    {
        int pogodak;
        cin >> pogodak;
        polja[N+pogodak]--;
    }
    for(int i = 0;i<= 2*N;i++)
    {
        if(polja[i] <= 0)
        {
            resenja.push_back(i-N);
            brojac++;
        }
    }
    cout << brojac << endl;
    for(int i = 0;i< resenja.size();i++)
    {
        cout << resenja.at(i) << " ";
    }
    return 0;
}