#include <iostream>
#include<cmath>
#include<algorithm>

using namespace std;

int br[2000006];

int main()
{
    ios::sync_with_stdio(false);

    int n,k,i,m=1000000,res=0,x;

    cin>>n>>k;
    for(i=1;i<=n;i++)
    {
        cin>>x;
        if(x==0) br[0]++;
        else if(x<0) br[x*(-1)]++;
        else br[x+m]++;
    }

    for(i=0;i<=2*m;i++)  if(br[i]>=k) res++;


    cout<<res<<endl;
    for(i=m;i>=1;i--) if(br[i]>=k) cout<<-1*i<<" ";
    if(br[0]>=k) cout<<"0 ";
    for(i=m+1;i<=2*m;i++) if(br[i]>=k) cout<<i-m<<" ";

    return 0;
}