#include <bits/stdc++.h>
using namespace std;
#define N 1000005

int n,k,sol=0;
int m[2*N];
vector<int> potroseni;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //int start=clock();

    cin >> n >> k;
    for(int i=1;i<=n;i++)
    {
        int x;cin >> x;
        if(x<0)x=N-x;
        m[x]++;
    }
    for(int i=N+1;i<=2*N;i++)
    {
        if(m[i]>=k)
        {
            sol++;
            potroseni.push_back((i-N)*(-1));
        }
    }
    for(int i=0;i<=N;i++)
    {
        if(m[i]>=k)
        {
            sol++;
            potroseni.push_back(i);
        }
    }
    cout << sol << "\n";
    for(auto x:potroseni)cout << x << " ";

    /*int endd = clock();
    cout << "\n" << ((endd-start)/CLOCKS_PER_SEC)*1000 << "ms";*/
    return 0;
}