#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long  n, k;
    cin >> n >> k;
    long long  a[n];
    long long b[n];
    long long c[n];
    long long cnt;
    long long br;


    for(int i = 0;i <= n;i++)
    {
        b[i] = 0;
        c[i] = 0;

    }


    for(int i = 1;i <= n;i++)
    {
        cin >> cnt;
        a[i] = cnt;
       if(cnt >= 0)
        b[cnt]++;
        else c[abs(cnt)]++;



    }
br = 0;
    for(int i = 0;i <= n;i++){
        if (c[i] >= k)
            br++;

         if (b[i] >= k)
            br++;



    }


    cout << br << endl;
    for(int i = 0;i <= n;i++){
        if (c[i] >= k)
            cout << i - (2*i)<<" ";

         if (b[i] >= k)
            cout << i << " ";



    }



    return 0;
}